PersistentObject PersistentObject(
$tablename
$tablename, $unique_set
$unique_set, [$cache_by
$cache_by = NULL], [$use_cache
$use_cache = true], [$is_transient
$is_transient = false], [$allowCreate
$allowCreate = true]
)
|
|
Prime instantiator for Zenphoto objects
Parameters:
|
$tablename |
$tablename: |
The name of the database table |
|
$unique_set |
$unique_set: |
An array of unique fields |
|
$cache_by |
$cache_by: |
|
|
$use_cache |
$use_cache: |
|
|
$is_transient |
$is_transient: |
Set true to prevent database insertion |
|
$allowCreate |
$allowCreate: |
Set true to allow a new object to be made. |
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:
Redefined in descendants as:
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:
Returns the id
Redefined in descendants as:
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
Redefined in descendants as:
Save the updates made to this object since the last update. Returns true if successful, false if not.
Redefined in descendants as:
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.
API Tags:
Redefined in descendants as: