19 require_once(BASE.
"wcmf/lib/model/mapper/class.RDBMapper.php");
20 require_once(BASE.
"wcmf/lib/persistence/class.PersistenceFacade.php");
21 require_once(BASE.
"wcmf/lib/persistence/converter/class.DataConverter.php");
22 require_once(BASE.
"wcmf/lib/model/class.Table.php");
56 foreach($objectData[
'_datadef'] as $dataItem)
58 if ($attribs == null || in_array($dataItem[
'name'], $attribs))
60 $valueProperties = array();
61 foreach($dataItem as $key => $value)
63 $valueProperties[$key] = $value;
66 foreach($objectData[
'_data'] as $row)
69 $value = $this->_dataConverter->convertStorageToApplication($row[$dataItem[
'name']], $dataItem[
'db_data_type'], $dataItem[
'name']);
70 $object->setValue($rowId, $value, $dataItem[
'name']);
71 $object->setValueProperties($rowId, $valueProperties, $dataItem[
'name']);
83 foreach($objectData[
'_datadef'] as $dataItem)
85 if ($attribs == null || in_array($dataItem[
'name'], $attribs))
87 $valueProperties = array();
88 foreach($dataItem as $key => $value)
90 $valueProperties[$key] = $value;
92 $value = $this->_dataConverter->convertStorageToApplication($dataItem[
'default'], $dataItem[
'db_data_type'], $dataItem[
'name']);
93 $object->setValue(0, $value, $dataItem[
'name']);
94 $object->setValueProperties(0, $valueProperties, $dataItem[
'name']);
119 WCMFException::throwEx(
"getObjectDefinition() must be implemented by derived class: ".get_class($this), __FILE__, __LINE__);
RDBMapper maps objects of one type to a relational database schema. It defines a persistence mechanis...
applyDataOnCreate(&$object, $objectData, $attribs)
TableRDBMapper maps Table objects to a relational database schema where one object contains several t...
appendObject(&$object, &$dependendObject)
throwEx($message, $file='', $line='')
applyDataOnLoad(&$object, $objectData, $attribs)
getChildrenSelectSQL($oid, $compositionOnly=false)
Table is a PersistentObject that holds a table structure. The rows of the table correspond to the val...
& createObject($oid=null)