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')). |
Add a dataobject to the cache
Parameters:
Redefined in descendants as:
void clear(
[
$keep_shadow = false]
)
|
|
Clear the cache **extensively**
Parameters:
Redefined in descendants as:
boolean dbdelete_by_ID(
integer
$req_ID
)
|
|
Delete an object from DB by ID.
Parameters:
|
integer |
$req_ID: |
ID of object to delete |
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:
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:
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() |
Get an array of all (loaded) IDs.
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() |
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:
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:
Load the cache **extensively**
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 |
void &new_obj(
[
$row = NULL]
)
|
|
Instanciate a new object within this cache
Parameters:
Redefined in descendants as:
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: