wCMF
3.6
|
Public Member Functions | |
__sleep () | |
& | load ($oid, $buildDepth, $buildAttribs=null, $buildTypes=null) |
& | create ($type, $buildDepth, $buildAttribs=null) |
save (&$object) | |
delete ($oid, $recursive=true) | |
getCreatedOIDs ($type) | |
getLastCreatedOID ($type) | |
getOIDs ($type, $criteria=null, $orderby=null, &$pagingInfo) | |
getOIDsEx ($type, $where=null, $orderby=null, &$pagingInfo) | |
getFirstOID ($type, $criteria=null, $orderby=null, &$pagingInfo) | |
getFirstOIDEx ($type, $where=null, $orderby=null, &$pagingInfo) | |
loadObjects ($type, $buildDepth, $criteria=null, $orderby=null, &$pagingInfo, $buildAttribs=null, $buildTypes=null) | |
& | loadFirstObject ($type, $buildDepth, $criteria=null, $orderby=null, &$pagingInfo, $buildAttribs=null, $buildTypes=null) |
startTransaction () | |
commitTransaction () | |
rollbackTransaction () | |
& | getMapper ($type) |
getClassFile ($parser, $className) | |
setMapper ($type, &$mapper) | |
storeConnection ($initParams, &$connection) | |
setReadOnly ($isReadOnly) | |
enableLogging ($logStrategy) | |
disableLogging () | |
isLogging () | |
setCaching ($isCaching) | |
clearCache () | |
getCacheKey ($oid, $buildDepth, $buildAttribs, $buildTypes) | |
getId () | |
valueChanged (&$object, $name, $type, $oldValue, $newValue) | |
propertyChanged (&$object, $name, $oldValue, $newValue) | |
stateChanged (&$object, $oldValue, $newValue) | |
![]() | |
getId () | |
valueChanged (&$object, $name, $type, $oldValue, $newValue) | |
propertyChanged (&$object, $name, $oldValue, $newValue) | |
stateChanged (&$object, $oldValue, $newValue) | |
Public Attributes | |
$_mapperObjects = array() | |
$_createdOIDs = array() | |
$_dbConnections = array() | |
$_cache = array() | |
$_logging = false | |
$_logStrategy = null | |
$_isReadOnly = false | |
$_isCaching = false | |
$_inTransaction = false | |
PersistenceFacadeImpl delegates persistence operations to the type-specific PersistenceMappers.
wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH
Licensed under the terms of any of the following licenses at your choice:
See the license.txt file distributed with this work for additional information.
Definition at line 45 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::__sleep | ( | ) |
Prevent anything to be stored in the session
Definition at line 60 of file class.PersistenceFacadeImpl.php.
& PersistenceFacadeImpl::load | ( | $oid, | |
$buildDepth, | |||
$buildAttribs = null , |
|||
$buildTypes = null |
|||
) |
Load an object from the database.
oid | OID of the object to construct |
buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build (except BUILDDEPTH_REQUIRED) |
buildAttribs | An assoziative array listing the attributes to load (default: null loads all attributes) (keys: the types, values: an array of attributes of the type to load) Use this to load only a subset of attributes |
buildTypes | An array listing the (sub-)types to include |
Definition at line 71 of file class.PersistenceFacadeImpl.php.
References BUILDDEPTH_INFINITE, BUILDDEPTH_SINGLE, PersistenceFacade\decomposeOID(), getCacheKey(), getMapper(), and WCMFException\throwEx().
& PersistenceFacadeImpl::create | ( | $type, | |
$buildDepth, | |||
$buildAttribs = null |
|||
) |
Construct the template of an Object of a given type.
type | The type of object to build |
buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build |
buildAttribs | An assoziative array listing the attributes to create (default: null creates all attributes) (keys: the types, values: an array of attributes of the type to create) Use this to create only a subset of attributes |
Definition at line 121 of file class.PersistenceFacadeImpl.php.
References BUILDDEPTH_INFINITE, BUILDDEPTH_REQUIRED, BUILDDEPTH_SINGLE, getMapper(), and WCMFException\throwEx().
PersistenceFacadeImpl::save | ( | & | $object | ) |
Save an object to the database (inserted if it is new).
object | A reference to the object to save |
Definition at line 143 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::delete | ( | $oid, | |
$recursive = true |
|||
) |
Delete an object from the database (together with all of its children).
oid | The object id of the object to delete |
recursive | True/False whether to physically delete it's children too [default: true] |
Definition at line 160 of file class.PersistenceFacadeImpl.php.
References PersistenceFacade\decomposeOID(), and getMapper().
PersistenceFacadeImpl::getCreatedOIDs | ( | $type | ) |
Get the object ids of newly created objects of a given type.
type | The type of the object |
Definition at line 177 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::getLastCreatedOID | ( | $type | ) |
Get the object id of the last created object of a given type.
type | The type of the object |
Definition at line 188 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::getOIDs | ( | $type, | |
$criteria = null , |
|||
$orderby = null , |
|||
& | $pagingInfo | ||
) |
Get the object ids of objects matching a given criteria. If a PagingInfo instance is passed it will be used and updated.
type | The type of the object |
criteria | An assoziative array holding name value pairs of attributes for selecting objects or a single string representing a (mapper specific) query condition (maybe null). [default: null] |
orderby | An array holding names of attributes to order by (maybe null). [default: null] |
pagingInfo | A reference PagingInfo instance (optional, default null does not work in PHP4). |
Definition at line 203 of file class.PersistenceFacadeImpl.php.
References getMapper().
Referenced by getFirstOID().
PersistenceFacadeImpl::getOIDsEx | ( | $type, | |
$where = null , |
|||
$orderby = null , |
|||
& | $pagingInfo | ||
) |
Definition at line 214 of file class.PersistenceFacadeImpl.php.
References Log\error(), and WCMFException\getStackTrace().
PersistenceFacadeImpl::getFirstOID | ( | $type, | |
$criteria = null , |
|||
$orderby = null , |
|||
& | $pagingInfo | ||
) |
Get the first object id of objects matching a given condition. If a PagingInfo instance is passed it will be used and updated.
type | The type of the object |
criteria | An assoziative array holding name value pairs of attributes for selecting objects or a single string representing a (mapper specific) query condition (maybe null). [default: null] |
orderby | An array holding names of attributes to ORDER by (maybe null). [default: null] |
pagingInfo | A reference PagingInfo instance (optional, default null does not work in PHP4). |
Definition at line 227 of file class.PersistenceFacadeImpl.php.
References getOIDs().
PersistenceFacadeImpl::getFirstOIDEx | ( | $type, | |
$where = null , |
|||
$orderby = null , |
|||
& | $pagingInfo | ||
) |
Definition at line 238 of file class.PersistenceFacadeImpl.php.
References Log\error(), and WCMFException\getStackTrace().
PersistenceFacadeImpl::loadObjects | ( | $type, | |
$buildDepth, | |||
$criteria = null , |
|||
$orderby = null , |
|||
& | $pagingInfo, | ||
$buildAttribs = null , |
|||
$buildTypes = null |
|||
) |
Load the objects matching a given condition. If a PagingInfo instance is passed it will be used and updated.
type | The type of the object |
buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build (except BUILDDEPTH_REQUIRED) |
criteria | An assoziative array holding name value pairs of attributes for selecting objects or a single string representing a (mapper specific) query condition (maybe null). [default: null] |
orderby | An array holding names of attributes to ORDER by (maybe null). [default: null] |
pagingInfo | A reference PagingInfo instance (optional, default null does not work in PHP4). |
buildAttribs | An assoziative array listing the attributes to load (default: null loads all attributes) (keys: the types, values: an array of attributes of the type to load) Use this to load only a subset of attributes |
buildTypes | An array listing the (sub-)types to include |
Definition at line 256 of file class.PersistenceFacadeImpl.php.
References getMapper().
Referenced by loadFirstObject().
& PersistenceFacadeImpl::loadFirstObject | ( | $type, | |
$buildDepth, | |||
$criteria = null , |
|||
$orderby = null , |
|||
& | $pagingInfo, | ||
$buildAttribs = null , |
|||
$buildTypes = null |
|||
) |
Load the first object matching a given condition. If a PagingInfo instance is passed it will be used and updated.
type | The type of the object |
buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build (except BUILDDEPTH_REQUIRED) |
criteria | An assoziative array holding name value pairs of attributes for selecting objects or a single string representing a (mapper specific) query condition (maybe null). [default: null] |
orderby | An array holding names of attributes to ORDER by (maybe null). [default: null] |
pagingInfo | A reference PagingInfo instance (optional, default null does not work in PHP4). |
buildAttribs | An assoziative array listing the attributes to load (default: null loads all attributes) (keys: the types, values: an array of attributes of the type to load) Use this to load only a subset of attributes |
buildTypes | An array listing the (sub-)types to include |
Definition at line 278 of file class.PersistenceFacadeImpl.php.
References loadObjects().
PersistenceFacadeImpl::startTransaction | ( | ) |
Start a transaction. Used for PersistenceMapper classes that need to explicitely start and commit transactions. If this method is called, the startTransaction() method of every used PersistenceMapper will be called - until commitTransaction() is called.
Definition at line 293 of file class.PersistenceFacadeImpl.php.
References Log\debug(), and isLogging().
PersistenceFacadeImpl::commitTransaction | ( | ) |
Commit the started transaction. Used for PersistenceMapper classes that need to explicitely start and commit transactions. If this method is called, the commitTransaction() method of every used PersistenceMapper will be called.
Definition at line 315 of file class.PersistenceFacadeImpl.php.
References Log\debug(), and isLogging().
PersistenceFacadeImpl::rollbackTransaction | ( | ) |
Rollback the started transaction. Used for PersistenceMapper classes that need to explicitely start and commit transactions. If this method is called, the rollbackTransaction() method of every used PersistenceMapper will be called.
Definition at line 337 of file class.PersistenceFacadeImpl.php.
References Log\debug(), and isLogging().
& PersistenceFacadeImpl::getMapper | ( | $type | ) |
Get the PersistenceMapper for a given type. If no mapper for this type is defined the mapper for type '*' will be returned
type | The type of the object to get the PersistenceMapper for |
Definition at line 357 of file class.PersistenceFacadeImpl.php.
References getClassFile(), InifileParser\getInstance(), and WCMFException\throwEx().
Referenced by create(), delete(), getOIDs(), load(), and loadObjects().
PersistenceFacadeImpl::getClassFile | ( | $parser, | |
$className | |||
) |
Get the class file name from the classmapping section of ini file
parser | The ini file parser |
className | The class name |
Definition at line 460 of file class.PersistenceFacadeImpl.php.
References WCMFException\throwEx().
Referenced by getMapper().
PersistenceFacadeImpl::setMapper | ( | $type, | |
& | $mapper | ||
) |
Explicitly set a PersistentMapper for a type
type | The type to set the mapper for |
mapper | A reference to the mapper |
Definition at line 474 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::storeConnection | ( | $initParams, | |
& | $connection | ||
) |
Store a connection for reuse
initParams | The initParams used to initialize the conenction |
connection | A reference to the connection to save |
Definition at line 483 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::setReadOnly | ( | $isReadOnly | ) |
Set state to readonly. If set to true, PersistenceFacade will return only immutable objects and save/delete methods are disabled.
isReadOnly | True/False whether objects should be readonly or not |
Definition at line 496 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::enableLogging | ( | $logStrategy | ) |
Enable logging using a given OutputStrategy to log insert/update/delete actions to a file.
logStrategy | The OutputStrategy to use. |
Definition at line 504 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::disableLogging | ( | ) |
Disable logging.
Definition at line 516 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::isLogging | ( | ) |
Check if the PersistenceMapper is logging.
Definition at line 528 of file class.PersistenceFacadeImpl.php.
References $_logging.
Referenced by commitTransaction(), rollbackTransaction(), and startTransaction().
PersistenceFacadeImpl::setCaching | ( | $isCaching | ) |
Set state to caching. If set to true, PersistenceFacade will cache all loaded objects and returns cached instances when calling the PersistenceFacade::load method.
isCaching | True/False whether objects should be chached or not |
Definition at line 537 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::clearCache | ( | ) |
Clear the object cache
Definition at line 544 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::getCacheKey | ( | $oid, | |
$buildDepth, | |||
$buildAttribs, | |||
$buildTypes | |||
) |
Get cache key from the given parameters
oid | OID of the object |
buildDepth | One of the BUILDDEPTH constants |
buildAttribs | An assoziative array ( |
buildTypes | An array ( |
Definition at line 556 of file class.PersistenceFacadeImpl.php.
Referenced by load().
PersistenceFacadeImpl::getId | ( | ) |
ChangeListener interface implementation
Definition at line 572 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::valueChanged | ( | & | $object, |
$name, | |||
$type, | |||
$oldValue, | |||
$newValue | |||
) |
Definition at line 579 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::propertyChanged | ( | & | $object, |
$name, | |||
$oldValue, | |||
$newValue | |||
) |
Definition at line 583 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::stateChanged | ( | & | $object, |
$oldValue, | |||
$newValue | |||
) |
Definition at line 587 of file class.PersistenceFacadeImpl.php.
References STATE_CLEAN, and STATE_NEW.
PersistenceFacadeImpl::$_mapperObjects = array() |
Definition at line 47 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::$_createdOIDs = array() |
Definition at line 48 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::$_dbConnections = array() |
Definition at line 49 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::$_cache = array() |
Definition at line 50 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::$_logging = false |
Definition at line 51 of file class.PersistenceFacadeImpl.php.
Referenced by isLogging().
PersistenceFacadeImpl::$_logStrategy = null |
Definition at line 52 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::$_isReadOnly = false |
Definition at line 53 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::$_isCaching = false |
Definition at line 54 of file class.PersistenceFacadeImpl.php.
PersistenceFacadeImpl::$_inTransaction = false |
Definition at line 55 of file class.PersistenceFacadeImpl.php.