b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 2.4) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: DataObjectCache

Source Location: /blogs/inc/_core/model/dataobjects/_dataobjectcache.class.php

Class DataObjectCache

Direct descendents
Child Class Description
SkinCache Skin Cache Class
FiletypeCache FiletypeCache Class
FileCache FileCache Class
WidgetCache Widget Cache Class
LinkCache LinkCache Class
ItemTypeCache ItemTypeCache Class
ItemCache Item Cache Class
UserCache Blog Cache Class
GenericCache GenericCache Class
BlogCache Blog 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   $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_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   $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 112]

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

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')).


[ Top ]
add  [line 246]

  void add( &$Obj  )

Add a dataobject to the cache

Parameters:
   &$Obj: 


Redefined in descendants as:

[ Top ]
clear  [line 318]

  void clear( [ $keep_shadow = false]  )

Clear the cache **extensively**

Parameters:
   $keep_shadow: 


Redefined in descendants as:

[ Top ]
dbdelete_by_ID  [line 530]

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

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

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

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

  array get_ID_array( )

Get an array of all (loaded) IDs.



[ Top ]
get_next  [line 365]

  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_list  [line 559]

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

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


Redefined in descendants as:

[ Top ]
instantiate  [line 280]

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

  void load_all( )

Load the cache **extensively**



[ Top ]
load_list  [line 202]

  void load_list( string $req_list  )

Load a list of objects into the cache

Parameters:
string   $req_list:  list of IDs of objects to load


[ Top ]
new_obj  [line 151]

  void &new_obj( [ $row = NULL]  )

Instanciate a new object within this cache

Parameters:
   $row: 


Redefined in descendants as:

[ Top ]
remove_by_ID  [line 518]

  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 ]

Documentation generated on Sat, 06 Mar 2010 03:31:01 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).