Class cItemBaseAbstract.
Base class with common features for database based items and item collections.
| copyright | four for business AG |
|---|
escape(string $sString) : string
stringThe string to escape
stringEscaped stringregister(string $event, mixed $callback, mixed $class) : void
Example: cGenericDb::register(cGenericDb::CREATE_SUCCESS, 'itemCreateHandler', 'cApiArticle'); cGenericDb::register(cGenericDb::CREATE_SUCCESS, array('cCallbackHandler', 'executeCreateHandle'), 'cApiArticle');
| inherited_from | \cGenericDb::register() |
|---|
stringCallback event, must be a valid value of a cGenericDb event constant
mixedCallback to register
mixedClass name for registering callback (can be string of array with names of the concrete Item classes)
\cInvalidArgumentException |
if event or class are not set or the callback is not callable |
|---|
unregister(string $event, mixed $class) : void
Example: cGenericDb::unregister(cGenericDb::CREATE_SUCCESS, 'cApiArticle');
| inherited_from | \cGenericDb::unregister() |
|---|
stringCallback event, must be a valid value of a cGenericDb event constant
mixedClass name for unregistering callback (can be string of array with names of the concrete Item classes)
\cInvalidArgumentException |
if the event or the class are not set |
|---|
__construct(string $sTable, string $sPrimaryKey, string $sClassName, int $iLifetime) : void
stringName of table
stringPrimary key of table
stringName of parent class
intLifetime of the object in seconds (NOT USED!)
\cInvalidArgumentException |
If table name or primary key is not set |
|---|
_executeCallbacks(string $event, string $class, array $arguments) : void
| inherited_from | \cGenericDb::_executeCallbacks() |
|---|
stringCallback event, must be a valid value of a cGenericDb event constant
stringClass name for executing callback
arrayArguments to pass to the callback function
\cInvalidArgumentException |
if the event or class is not set |
|---|
_getPropertiesCollectionInstance() : \cApiPropertyCollection
_getSecondDBInstance() : \cDb
$primaryKey : string
| todo | remove access from public |
|---|
$virgin : bool
If true, the object is virgin and no operations on it except load-Functions are allowed.
| todo | remove access from public |
|---|
$_className : string
$_oCache : \cItemCache
$_settings : array
$cache : array
$db : \cDb
$lasterror : string
$lifetime : int
$properties : \cApiPropertyCollection
$secondDb : \cDb
$table : string
$_callbacks : array
| inherited_from | \cGenericDb::$$_callbacks |
|---|
CREATE_BEFORE
Expected parameters for callback: none
| inherited_from | \cGenericDb::CREATE_BEFORE |
|---|
CREATE_FAILURE
Expected parameters for callback: none
| inherited_from | \cGenericDb::CREATE_FAILURE |
|---|
CREATE_SUCCESS
Expected parameters for callback: ID of created item
| inherited_from | \cGenericDb::CREATE_SUCCESS |
|---|
DELETE_BEFORE
Expected parameters for callback: ID of them item to delete
| inherited_from | \cGenericDb::DELETE_BEFORE |
|---|
DELETE_FAILURE
Expected parameters for callback: ID of them item to delete
| inherited_from | \cGenericDb::DELETE_FAILURE |
|---|
DELETE_SUCCESS
Expected parameters for callback: ID of them item to delete
| inherited_from | \cGenericDb::DELETE_SUCCESS |
|---|
STORE_BEFORE
Expected parameters for callback: Item instance
| inherited_from | \cGenericDb::STORE_BEFORE |
|---|
STORE_FAILURE
This is also likely to happen if query would not change anything in database! Expected parameters for callback: Item instance
| inherited_from | \cGenericDb::STORE_FAILURE |
|---|
STORE_SUCCESS
Expected parameters for callback: Item instance
| inherited_from | \cGenericDb::STORE_SUCCESS |
|---|