phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Class: DataObjectCache

Source Location: /qp_inc/_core/model/dataobjects/_dataobjectcache.class.php

Class DataObjectCache

Descendants
Child Class Description
BlogCache Blog Cache Class
FileCache FileCache Class
FiletypeCache FiletypeCache Class
GenericCache GenericCache Class
ItemCache Item Cache Class
ItemTypeCache ItemTypeCache Class
LinkCache LinkCache Class
TemplateCache Template Cache Class
UserCache Blog Cache Class
WidgetCache Widget Cache Class

[ Top ]
Property Summary
mixed   $all_loaded  
mixed   $cache   Object array by ID
mixed   $current_idx   Index of current iteration
array   $DataObject_array   NON indexed object array
mixed   $dbIDname  
mixed   $dbprefix  
mixed   $dbtablename  
mixed   $load_all  
mixed   $name_field  
string   $none_option_text   The text that gets used for the "None" option in the objects options list.
mixed   $none_option_value   The value that gets used for the "None" option in the objects options list.
mixed   $objtype   Class name of objects in this cache:
mixed   $order_by  
mixed   $shadow_cache   Copy of previous object array

[ Top ]
Method Summary
DataObjectCache   DataObjectCache()   Constructor
void   add()   Add a dataobject to the cache
void   clear()   Clear the cache **extensively**
boolean   dbdelete_by_ID()   Delete an object from DB by ID.
DataObject   &get_by_ID()   Get an object from cache by ID
reference   &get_by_name()   Get an object from cache by name
DataObject   &get_first()   This provides a simple interface for looping over the contents of the Cache.
array   get_ID_array()   Get an array of all (loaded) IDs.
DataObject   &get_next()   This provides a simple interface for looping over the contents of the Cache.
string   get_option_array()   Returns option array with cache contents
string   get_option_list()   Returns form option list with cache contents
Object   &instantiate()   Instantiate a DataObject from a table row and then cache it.
void   load_all()   Load the cache **extensively**
void   load_list()   Load a list of objects into the cache
void   &new_obj()   Instanciate a new object within this cache
void   remove_by_ID()   Remove an object from cache by ID

[ Top ]
Properties
mixed   $all_loaded = false [line 84]

[ Top ]
mixed   $cache = array() [line 63]

Object array by ID


[ Top ]
mixed   $current_idx = NULL [line 81]

Index of current iteration

API Tags:
See:  DataObjectCache::get_next()


[ Top ]
array   $DataObject_array = array() [line 75]

NON indexed object array


[ Top ]
mixed   $dbIDname [line 53]

[ Top ]
mixed   $dbprefix [line 52]

[ Top ]
mixed   $dbtablename [line 51]

[ Top ]
mixed   $load_all = false [line 83]

[ Top ]
mixed   $name_field [line 87]

[ Top ]
string   $none_option_text [line 97]

The text that gets used for the "None" option in the objects options list.

This is especially useful for i18n, because there are several "None"s!


[ Top ]
mixed   $none_option_value [line 104]

The value that gets used for the "None" option in the objects options list.


[ Top ]
mixed   $objtype [line 58]

Class name of objects in this cache:


[ Top ]
mixed   $order_by [line 88]

[ Top ]
mixed   $shadow_cache = NULL [line 69]

Copy of previous object array

API Tags:
See:  DataObjectCache::clear()


[ Top ]
Methods
Constructor DataObjectCache  [line 120]

  DataObjectCache DataObjectCache( string $objtype, boolean $load_all, string $tablename, [string $prefix = ''], string $dbIDname, [string $name_field = NULL], [string $order_by = ''], [string $allow_none_text = NULL], [mixed $allow_none_value = '']  )

Constructor

Parameters:
string   $objtype:  Name of DataObject class we are cacheing
boolean   $load_all:  true if it's OK to just load all items!
string   $tablename:  Name of table in database
string   $prefix:  Prefix of fields in the table
string   $dbIDname:  Name of the ID field (including prefix)
string   $name_field:  Name of the name field (including prefix)
string   $order_by:  field names or NULL to use name field
string   $allow_none_text:  The text that gets used for the "None" option in the objects options list (Default: T_('None')).
mixed   $allow_none_value:  The value that gets used for the "None" option in the objects options list.


[ Top ]
add  [line 256]

  void add( &$Obj  )

Add a dataobject to the cache

Parameters:
   &$Obj: 


Redefined in descendants as:

[ Top ]
clear  [line 326]

  void clear( [ $keep_shadow = false]  )

Clear the cache **extensively**

Parameters:
   $keep_shadow: 


Redefined in descendants as:

[ Top ]
dbdelete_by_ID  [line 537]

  boolean dbdelete_by_ID( integer $req_ID  )

Delete an object from DB by ID.

Parameters:
integer   $req_ID:  ID of object to delete


[ Top ]
get_by_ID  [line 398]

  DataObject &get_by_ID( integer $req_ID, [boolean $halt_on_error = true], [boolean $halt_on_empty = true]  )

Get an object from cache by ID

Load the cache if necessary (all at once if allowed).

Parameters:
integer   $req_ID:  ID of object to load
boolean   $halt_on_error:  true if function should die on error
boolean   $halt_on_empty:  true if function should die on empty/null

API Tags:
Return:  reference on cached object


Redefined in descendants as:

[ Top ]
get_by_name  [line 469]

  reference &get_by_name( integer $req_name, [boolean $halt_on_error = true], [boolean $halt_on_empty = true]  )

Get an object from cache by name

Load the cache if necessary (all at once if allowed).

Parameters:
integer   $req_name:  ID of object to load
boolean   $halt_on_error:  true if function should die on error
boolean   $halt_on_empty:  true if function should die on empty/null

API Tags:
Return:  on cached object


[ Top ]
get_first  [line 354]

  DataObject &get_first( )

This provides a simple interface for looping over the contents of the Cache.

This should only be used for basic enumeration. If you need complex filtering of the cache contents, you should probablt use a DataObjectList instead.


API Tags:
See:  DataObject::get_next()


[ Top ]
get_ID_array  [line 240]

  array get_ID_array( )

Get an array of all (loaded) IDs.



[ Top ]
get_next  [line 373]

  DataObject &get_next( )

This provides a simple interface for looping over the contents of the Cache.

This should only be used for basic enumeration. If you need complex filtering of the cache contents, you should probablt use a DataObjectList instead.


API Tags:
See:  DataObject::get_first()


[ Top ]
get_option_array  [line 622]

  string get_option_array( [string $method = 'get_name'], [array $ignore_IDs = array()]  )

Returns option array with cache contents

Load the cache if necessary

Parameters:
string   $method:  Callback method name
array   $ignore_IDs:  IDs to ignore.


Redefined in descendants as:

[ Top ]
get_option_list  [line 567]

  string get_option_list( [integer $default = 0], [boolean $allow_none = false], [string $method = 'get_name'], [array $ignore_IDs = array()]  )

Returns form option list with cache contents

Load the cache if necessary

Parameters:
integer   $default:  selected ID
boolean   $allow_none:  provide a choice for "none" with ID ''
string   $method:  Callback method name
array   $ignore_IDs:  IDs to ignore.


Redefined in descendants as:

[ Top ]
instantiate  [line 290]

  Object &instantiate( Object &$db_row  )

Instantiate a DataObject from a table row and then cache it.

Parameters:
Object   &$db_row:  Database row


Redefined in descendants as:

[ Top ]
load_all  [line 174]

  void load_all( )

Load the cache **extensively**



[ Top ]
load_list  [line 212]

  void load_list( string $req_list, [boolean $invert = false]  )

Load a list of objects into the cache

Parameters:
string   $req_list:  list of IDs of objects to load
boolean   $invert:  Invert list: Load all objects except those listed in the first parameter


[ Top ]
new_obj  [line 160]

  void &new_obj( [ $row = NULL]  )

Instanciate a new object within this cache

Parameters:
   $row: 


Redefined in descendants as:

[ Top ]
remove_by_ID  [line 525]

  void remove_by_ID( integer $req_ID  )

Remove an object from cache by ID

Parameters:
integer   $req_ID:  ID of object to remove


Redefined in descendants as:

[ Top ]