wCMF
3.6
|
Public Member Functions | |
getType () | |
getPkNames () | |
setDataConverter ($dataConverter) | |
getDataConverter () | |
enableLogging ($logStrategy) | |
disableLogging () | |
isLogging () | |
logAction (&$obj) | |
& | load ($oid, $buildDepth, $buildAttribs=null, $buildTypes=null) |
& | create ($type, $buildDepth, $buildAttribs=null) |
save (&$object) | |
delete ($oid, $recursive=true) | |
checkAuthorization ($oid, $action) | |
authorizationFailedError ($oid, $action) | |
initialize (&$object) | |
isValidOID ($oid) | |
& | loadImpl ($oid, $buildDepth, $buildAttribs=null, $buildTypes=null) |
& | createImpl ($type, $buildDepth, $buildAttribs=null) |
saveImpl (&$object) | |
deleteImpl ($oid, $recursive=true) | |
getOIDs ($type, $criteria=null, $orderby=null, &$pagingInfo) | |
loadObjects ($type, $buildDepth, $criteria=null, $orderby=null, &$pagingInfo, $buildAttribs=null, $buildTypes=null) | |
getOrderBy () | |
startTransaction () | |
commitTransaction () | |
rollbackTransaction () | |
Public Attributes | |
$_dataConverter = null | |
$_type = '' | |
$_logging = false | |
$_logStrategy = null | |
PersistenceMapper is the base class for all mapper classes.
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 33 of file class.PersistenceMapper.php.
PersistenceMapper::getType | ( | ) |
Get the mapper type.
Definition at line 44 of file class.PersistenceMapper.php.
References $_type.
PersistenceMapper::getPkNames | ( | ) |
Get the names of the primary key values.
Definition at line 52 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
Referenced by NodeUnifiedRDBMapper\getPKColumnNames().
PersistenceMapper::setDataConverter | ( | $dataConverter | ) |
Set the DataConverter that should be used on load() and save().
dataConverter | The DataConverter object. |
Definition at line 60 of file class.PersistenceMapper.php.
PersistenceMapper::getDataConverter | ( | ) |
Get the DataConverter that is used on load() and save().
Definition at line 68 of file class.PersistenceMapper.php.
References $_dataConverter.
PersistenceMapper::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 76 of file class.PersistenceMapper.php.
PersistenceMapper::disableLogging | ( | ) |
Disable logging.
Definition at line 84 of file class.PersistenceMapper.php.
PersistenceMapper::isLogging | ( | ) |
Check if the PersistenceMapper is logging.
Definition at line 92 of file class.PersistenceMapper.php.
References $_logging.
Referenced by NodeToSingleTableMapper\delete(), NodeXMLDBMapper\deleteImpl(), RDBMapper\deleteImpl(), and logAction().
PersistenceMapper::logAction | ( | & | $obj | ) |
Log action if logging is enabled.
obj | The object on which the action is performed on. |
Definition at line 101 of file class.PersistenceMapper.php.
References isLogging().
Referenced by NodeToSingleTableMapper\delete(), NodeXMLDBMapper\deleteImpl(), RDBMapper\deleteImpl(), NodeToSingleTableMapper\save(), NodeXMLDBMapper\saveImpl(), and RDBMapper\saveImpl().
& PersistenceMapper::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 116 of file class.PersistenceMapper.php.
References ACTION_MODIFY, ACTION_READ, authorizationFailedError(), checkAuthorization(), initialize(), isValidOID(), and loadImpl().
& PersistenceMapper::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 151 of file class.PersistenceMapper.php.
References createImpl(), and initialize().
PersistenceMapper::save | ( | & | $object | ) |
Save an Object to the persistent storage.
object | A reference to the object to safe |
Definition at line 170 of file class.PersistenceMapper.php.
References ACTION_CREATE, ACTION_MODIFY, authorizationFailedError(), checkAuthorization(), saveImpl(), STATE_DIRTY, and STATE_NEW.
PersistenceMapper::delete | ( | $oid, | |
$recursive = true |
|||
) |
Delete an Object from the persistent storage.
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 192 of file class.PersistenceMapper.php.
References ACTION_DELETE, authorizationFailedError(), checkAuthorization(), deleteImpl(), LockManager\getInstance(), and isValidOID().
PersistenceMapper::checkAuthorization | ( | $oid, | |
$action | |||
) |
Check authorization on an type/OID and a given action.
oid | The object id of the Object to authorize (its type will be checked too) |
action | Action to authorize |
Definition at line 219 of file class.PersistenceMapper.php.
References RightsManager\getInstance().
Referenced by delete(), load(), and save().
PersistenceMapper::authorizationFailedError | ( | $oid, | |
$action | |||
) |
Definition at line 227 of file class.PersistenceMapper.php.
References ACTION_READ, Log\error(), Message\get(), WCMFException\getStackTrace(), and WCMFException\throwEx().
Referenced by delete(), load(), and save().
PersistenceMapper::initialize | ( | & | $object | ) |
Initialize the object after creation/loading and before handing it over to the application.
object | A reference to the object |
Definition at line 242 of file class.PersistenceMapper.php.
PersistenceMapper::isValidOID | ( | $oid | ) |
Validate a given OID.
oid | The OID of the object. |
Definition at line 251 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
Referenced by delete(), and load().
& PersistenceMapper::loadImpl | ( | $oid, | |
$buildDepth, | |||
$buildAttribs = null , |
|||
$buildTypes = null |
|||
) |
Definition at line 261 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
Referenced by load().
& PersistenceMapper::createImpl | ( | $type, | |
$buildDepth, | |||
$buildAttribs = null |
|||
) |
Definition at line 270 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
Referenced by create().
PersistenceMapper::saveImpl | ( | & | $object | ) |
Definition at line 279 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
Referenced by save().
PersistenceMapper::deleteImpl | ( | $oid, | |
$recursive = true |
|||
) |
Definition at line 288 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
Referenced by delete().
PersistenceMapper::getOIDs | ( | $type, | |
$criteria = null , |
|||
$orderby = null , |
|||
& | $pagingInfo | ||
) |
Definition at line 296 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
PersistenceMapper::loadObjects | ( | $type, | |
$buildDepth, | |||
$criteria = null , |
|||
$orderby = null , |
|||
& | $pagingInfo, | ||
$buildAttribs = null , |
|||
$buildTypes = null |
|||
) |
Definition at line 304 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
PersistenceMapper::getOrderBy | ( | ) |
Get the names of the attributes to order by, when retrieving the oids. ASC (ascending), DESC (descending) may be added to defined the order direction for each attribute.
Definition at line 313 of file class.PersistenceMapper.php.
References WCMFException\throwEx().
Referenced by NodeUnifiedRDBMapper\getSelectSQL().
PersistenceMapper::startTransaction | ( | ) |
Definition at line 321 of file class.PersistenceMapper.php.
PersistenceMapper::commitTransaction | ( | ) |
Definition at line 328 of file class.PersistenceMapper.php.
PersistenceMapper::rollbackTransaction | ( | ) |
Definition at line 335 of file class.PersistenceMapper.php.
PersistenceMapper::$_dataConverter = null |
Definition at line 35 of file class.PersistenceMapper.php.
Referenced by getDataConverter().
PersistenceMapper::$_type = '' |
Definition at line 36 of file class.PersistenceMapper.php.
Referenced by getType().
PersistenceMapper::$_logging = false |
Definition at line 37 of file class.PersistenceMapper.php.
Referenced by isLogging().
PersistenceMapper::$_logStrategy = null |
Definition at line 38 of file class.PersistenceMapper.php.