PersistentObject PersistentObject(
$tablename,
$unique_set, [
$cache_by = NULL], [
$use_cache = true], [
$is_transient = false]
)
|
|
Parameters:
|
|
$tablename: |
|
|
|
$unique_set: |
|
|
|
$cache_by: |
|
|
|
$use_cache: |
|
|
|
$is_transient: |
|
a cache(
[
$entry = NULL]
)
|
|
Caches the current set of objects defined by a variable key $cache_by.
Uses a global array to store the results of a single database query, where subsequent requests for the object look for data.
Parameters:
API Tags:
| Return: | reference to the array location where this class' cache is stored indexed by the field $cache_by. |
void copy(
$new_unique_set
)
|
|
Copy this record to another unique set. Checks if the record exists there first, if so returns false. If successful returns true. No changes are made to this object and no other objects are created, just the database entry.
A call to copy is instant, it does not require a save() following it.
Parameters:
void get(
$var, [
$current = true]
)
|
|
Get the value of a variable. If $current is false, return the value as of the last save of this object.
Parameters:
Load the data array from the database, using the unique id set to get the unique record.
API Tags:
| Return: | if the record already exists, true if a new record was created. |
void move(
$new_unique_set
)
|
|
Change one or more values of the unique set assigned to this record.
Checks if the record already exists first, if so returns false. If successful returns true and changes $this->unique_set A call to move is instant, it does not require a save() following it.
Parameters:
Deletes object from the database
Save the updates made to this object since the last update. Returns true if successful, false if not.
Set a variable in this object. Does not persist to the database until save() is called. So, IMPORTANT: Call save() after set() to persist.
If the requested variable is not in the database, sets it in temp storage, which won't be persisted to the database.
Parameters:
Sets default values for new objects using the set() method.
Should do nothing in the base class; subclasses should override.
Redefined in descendants as: