b2evolution

Multilingual multiuser multiblog engine

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

Class: DataObjectCache

Source Location: /blogs/inc/MODEL/dataobjects/_dataobjectcache.class.php

Class DataObjectCache

Direct descendents
Child Class Description
FiletypeCache Division Class
FileCache FileCache Class
ItemCache Item Cache Class
ItemTypeCache ItemTypeCache Class
LinkCache LinkCache Class
UserCache Blog Cache Class
BlogCache Blog Cache Class
GenericCache GenericCache Class

[ Top ]
Property Summary
mixed   $all_loaded  
mixed   $cache   Object array
mixed   $dbIDname  
mixed   $dbprefix  
mixed   $dbtablename  
mixed   $load_add  
mixed   $name_field  
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.
reference   &get_by_ID()   Get an object from cache by ID
reference   &get_by_name()   Get an object from cache by name
array   get_ID_array()   Get an array of all (loaded) IDs.
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()   TODO
void   option_list()   Display form option list with cache contents
void   option_list_return()   Returns form option list with cache contents
void   remove_by_ID()   Remove an object from cache by ID

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

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

Object array


[ Top ]
mixed   $dbIDname [line 51]

[ Top ]
mixed   $dbprefix [line 50]

[ Top ]
mixed   $dbtablename [line 49]

[ Top ]
mixed   $load_add = false [line 69]

[ Top ]
mixed   $name_field [line 71]

[ Top ]
mixed   $objtype [line 56]

Class name of objects in this cache:


[ Top ]
mixed   $order_by [line 72]

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

Copy of previous object array

API Tags:
See:  DataObjectCache::clear()


[ Top ]
Methods
Constructor DataObjectCache  [line 84]

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

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)
   $name_field: 
   $order_by: 


[ Top ]
add  [line 207]

  void add( &$Obj  )

Add a dataobject to the cache

Parameters:
   &$Obj: 


Redefined in descendants as:

[ Top ]
clear  [line 268]

  void clear( [ $keep_shadow = false]  )

Clear the cache **extensively**

Parameters:
   $keep_shadow: 


Redefined in descendants as:

[ Top ]
dbdelete_by_ID  [line 435]

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

  reference &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:  on cached object


[ Top ]
get_by_name  [line 366]

  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_ID_array  [line 191]

  array get_ID_array( )

Get an array of all (loaded) IDs.



[ Top ]
instantiate  [line 237]

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

  void load_all( )

Load the cache **extensively**



[ Top ]
load_list  [line 163]

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

  void &new_obj( [ $row = NULL]  )

TODO

Parameters:
   $row: 


Redefined in descendants as:

[ Top ]
option_list  [line 464]

  void option_list( [integer $default = 0], [boolean $allow_none = false], [ $method = 'name']  )

Display 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 ''
   $method: 

Information Tags:
Todo:  Shouldn't this use option_list_return()?

Redefined in descendants as:

[ Top ]
option_list_return  [line 497]

  void option_list_return( [integer $default = 0], [boolean $allow_none = false], [ $method = 'name_return']  )

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 ''
   $method: 


Redefined in descendants as:

[ Top ]
remove_by_ID  [line 422]

  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 Tue, 18 Dec 2007 23:11:56 +0100 by phpDocumentor 1.4.0