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

Class: PersistentObject

Source Location: /classes.php

Class PersistentObject

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

[ Top ]
Property Summary
mixed   $exists  
mixed   $id  
mixed   $loaded  
mixed   $table  
mixed   $transient  

[ Top ]
Method Summary
PersistentObject   PersistentObject()  
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.
array   getData()   returns the database record of the object
string   getID()   Returns the id
bool   instantiate()   Prime instantiator for Zenphoto objects
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.
string   __toString()   "Magic" function to return a string identifying the object when it is treated as a string

[ Top ]
Properties
mixed   $exists = false [line 42]

Redefined in descendants as:

[ Top ]
mixed   $id = 0 [line 45]
API Tags:
Access:  protected


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

[ Top ]
mixed   $table [line 43]

[ Top ]
mixed   $transient [line 44]

[ Top ]
Methods
Constructor PersistentObject  [line 57]

  PersistentObject PersistentObject( $tablename, $unique_set, [ $cache_by = NULL], [ $use_cache = true], [ $is_transient = false], [ $allowCreate = true]  )

Parameters:
   $tablename: 
   $unique_set: 
   $cache_by: 
   $use_cache: 
   $is_transient: 
   $allowCreate: 

API Tags:
Deprecated:  


[ Top ]
copy  [line 179]

  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:
  • AlbumBase::copy() : Copy this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
  • Album::copy() : Copy this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
  • dynamicAlbum::copy() : Copy this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
  • Image::copy() : Copies the image to a new album, along with all metadata.
  • ZenpageNews::copy() : duplicates an article
  • ZenpagePage::copy() : duplicates an article

[ Top ]
get  [line 267]

  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 ]
getData  [line 258]

  array getData( )

returns the database record of the object



[ Top ]
getID  [line 249]

  string getID( )

Returns the id



Redefined in descendants as:

[ Top ]
instantiate  [line 74]

  bool instantiate( $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.

API Tags:
Return:  will be true if the unique_set does not already exist


[ Top ]
move  [line 156]

  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: 


Redefined in descendants as:
  • AlbumBase::move() : Move this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
  • Album::move() : Move this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
  • dynamicAlbum::move() : Move this album to the location specified by $newfolder, copying all metadata, subalbums, and subalbums' metadata with it.
  • Image::move() : Moves an image to a new album and/or filename (rename).

[ Top ]
remove  [line 228]

  bool remove( )

Deletes object from the database



Redefined in descendants as:

[ Top ]
save  [line 329]

  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 131]

  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 146]

  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 ]
__toString  [line 409]

  string __toString( )

"Magic" function to return a string identifying the object when it is treated as a string


API Tags:
Access:  public


[ Top ]

Documentation generated on Sat, 07 Jun 2014 18:03:20 +0200 by phpDocumentor 1.4.3