[ class tree: classes ] [ index: classes ] [ all elements ]

Class: PersistentObject

Source Location: /classes.php

Class PersistentObject

Descendants
Child Class Description
Comment Comment Class
ThemeObject The basic ThemeObject class. Extends PersistentObject, is extended by various Theme related objects.
Zenphoto_Administrator

[ Top ]
Property Summary
mixed   $cache_by  
mixed   $data  
mixed   $id  
mixed   $loaded  
mixed   $table  
mixed   $tempdata  
mixed   $transient  
mixed   $unique_set  
mixed   $updates  
mixed   $use_cache  

[ Top ]
Method Summary
PersistentObject   PersistentObject()   Prime instantiator for Zenphoto objects
void   copy()   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.
void   get()   Get the value of a variable. If $current is false, return the value as of the last save of this object.
string   getID()   Returns the id
void   move()   Change one or more values of the unique set assigned to this record.
bool   remove()   Deletes object from the database
void   save()   Save the updates made to this object since the last update. Returns true if successful, false if not.
void   set()   Set a variable in this object. Does not persist to the database until save() is called. So, IMPORTANT: Call save() after set() to persist.
void   setDefaults()   Sets default values for new objects using the set() method.

[ Top ]
Properties
mixed   $cache_by [line 51]

[ Top ]
mixed   $data = NULL [line 46]

[ Top ]
mixed   $id = 0 [line 52]

[ Top ]
mixed   $loaded = false [line 48]

[ Top ]
mixed   $table [line 49]

[ Top ]
mixed   $tempdata = NULL [line 55]

[ Top ]
mixed   $transient [line 54]

[ Top ]
mixed   $unique_set = NULL [line 50]

[ Top ]
mixed   $updates = NULL [line 47]

[ Top ]
mixed   $use_cache = false [line 53]

[ Top ]
Methods
Constructor PersistentObject  [line 67]

  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.


[ Top ]
copy  [line 174]

  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:
   $new_unique_set: 


Redefined in descendants as:

[ Top ]
get  [line 247]

  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:
   $var: 
   $current: 


[ Top ]
getID  [line 238]

  string getID( )

Returns the id



Redefined in descendants as:

[ Top ]
move  [line 151]

  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:
   $new_unique_set: 


[ Top ]
remove  [line 217]

  bool remove( )

Deletes object from the database



Redefined in descendants as:

[ Top ]
save  [line 311]

  void save( )

Save the updates made to this object since the last update. Returns true if successful, false if not.



Redefined in descendants as:

[ Top ]
set  [line 127]

  void set( $var, $value  )

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:
   $var: 
   $value: 


[ Top ]
setDefaults  [line 142]

  void setDefaults( )

Sets default values for new objects using the set() method.

Should do nothing in the base class; subclasses should override.


API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]

Documentation generated on Tue, 20 Dec 2011 16:07:03 +0100 by phpDocumentor 1.4.3