19 require_once(BASE.
"wcmf/lib/core/class.WCMFException.php");
20 require_once(BASE.
"wcmf/lib/util/class.Log.php");
21 require_once(BASE.
"wcmf/lib/util/class.Message.php");
22 require_once(BASE.
"wcmf/lib/security/class.RightsManager.php");
23 require_once(BASE.
"wcmf/lib/persistence/class.LockManager.php");
24 require_once(BASE.
"wcmf/lib/persistence/class.PersistenceFacade.php");
54 WCMFException::throwEx(
"getPkNames() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
62 $this->_dataConverter = $dataConverter;
78 $this->_logStrategy = $logStrategy;
79 $this->_logging =
true;
86 $this->_logging =
false;
104 $this->_logStrategy->writeObject($obj);
116 function &
load($oid, $buildDepth, $buildAttribs=null, $buildTypes=null)
128 $object = &$this->
loadImpl($oid, $buildDepth, $buildAttribs, $buildTypes);
133 $object->setImmutable();
138 $object->afterLoad();
151 function &
create($type, $buildDepth, $buildAttribs=null)
156 $object = &$this->
createImpl($type, $buildDepth, $buildAttribs);
161 $object->afterCreate();
192 function delete($oid, $recursive=
true)
204 $result = $this->
deleteImpl($oid, $recursive);
205 if ($result ===
true)
209 $lockManager->releaseLocks($oid);
222 if (!$rightsManager->authorize($oid,
'', $action))
230 $msg =
Message::get(
"Authorization failed for action '%1%' on '%2%'.", array($action, $oid));
253 WCMFException::throwEx(
"isValidOID() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
261 function &
loadImpl($oid, $buildDepth, $buildAttribs=null, $buildTypes=null)
263 WCMFException::throwEx(
"loadImpl() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
272 WCMFException::throwEx(
"createImpl() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
281 WCMFException::throwEx(
"saveImpl() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
290 WCMFException::throwEx(
"deleteImpl() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
296 function getOIDs($type, $criteria=null, $orderby=null, &$pagingInfo)
298 WCMFException::throwEx(
"getOIDs() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
304 function loadObjects($type, $buildDepth, $criteria=null, $orderby=null, &$pagingInfo, $buildAttribs=null, $buildTypes=null)
306 WCMFException::throwEx(
"loadObjects() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
315 WCMFException::throwEx(
"getOrderBy() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
error($message, $category)
get($message, $parameters=null, $domain='', $lang='')
enableLogging($logStrategy)
& load($oid, $buildDepth, $buildAttribs=null, $buildTypes=null)
getOIDs($type, $criteria=null, $orderby=null, &$pagingInfo)
authorizationFailedError($oid, $action)
& create($type, $buildDepth, $buildAttribs=null)
throwEx($message, $file='', $line='')
setDataConverter($dataConverter)
deleteImpl($oid, $recursive=true)
& loadImpl($oid, $buildDepth, $buildAttribs=null, $buildTypes=null)
& createImpl($type, $buildDepth, $buildAttribs=null)
checkAuthorization($oid, $action)
PersistenceMapper is the base class for all mapper classes.
loadObjects($type, $buildDepth, $criteria=null, $orderby=null, &$pagingInfo, $buildAttribs=null, $buildTypes=null)