wCMF
3.6
|
Public Member Functions | |
initialize (&$object) | |
prepareInsert (&$object) | |
getObjectDefinition () | |
getSelectSQL ($condStr, $orderStr=null, $attribs=null, $asArray=false) | |
getChildrenSelectSQL ($oid, $compositionOnly=false) | |
getChildrenDisassociateSQL ($oid, $sharedOnly=false) | |
getInsertSQL (&$object) | |
getUpdateSQL (&$object) | |
getDeleteSQL ($oid) | |
createPKCondition ($oid) | |
isAttribute ($name) | |
isChild ($type, $childDef) | |
getChildDef ($type, $childDef) | |
isForeignKey ($column) | |
getSQLForRefs ($nodeDef, $attribStr, $tableStr, $condStr, $orderStr, $attribs=null) | |
translateAppToDatabase ($str) | |
getColumnName ($attributeName, $dataType=null) | |
getChildFKColumnName ($childType, $isRequired=true) | |
getMyFKColumnName ($parentType, $isRequired=true) | |
quote ($value) | |
getPKColumnNames () | |
isValidOID ($oid) | |
getId () | |
valueChanged (&$object, $name, $type, $oldValue, $newValue) | |
propertyChanged (&$object, $name, $oldValue, $newValue) | |
stateChanged (&$object, $oldValue, $newValue) | |
getObjectDefinitionImpl () | |
getTableName () | |
getMyFKColumnNameImpl ($parentType) | |
![]() | |
& | createObject ($oid=null) |
appendObject (&$object, &$dependendObject) | |
applyDataOnLoad (&$object, $objectData, $attribs) | |
applyDataOnCreate (&$object, $objectData, $attribs) | |
getObjectDefinition () | |
![]() | |
RDBMapper ($params) | |
__sleep () | |
connect () | |
getNextId () | |
getSequenceTablename () | |
executeSql ($sql, $isSelect=false) | |
select ($sql, &$pagingInfo) | |
isPkValue ($name, $dataType) | |
constructOID ($type, $data) | |
getPKNamesForType ($type) | |
& | loadImpl ($oid, $buildDepth, $buildAttribs=null, $buildTypes=null) |
& | createImpl ($type, $buildDepth, $buildAttribs=null) |
saveImpl (&$object) | |
deleteImpl ($oid, $recursive=true) | |
& | getConnection () |
getOIDs ($type, $criteria=null, $orderby=null, &$pagingInfo) | |
loadObjects ($type, $buildDepth, $criteria=null, $orderby=null, &$pagingInfo, $buildAttribs=null, $buildTypes=null, $selectChildOIDs=true, $omitObjects=false) | |
& | createObjectFromData ($attribs, $data=null) |
appendChildData (&$object, $buildDepth, $buildAttribs=null, $buildTypes=null) | |
startTransaction () | |
commitTransaction () | |
rollbackTransaction () | |
& | createObject ($oid=null) |
appendObject (&$object, &$dependendObject) | |
applyDataOnLoad (&$object, $objectData, $attribs) | |
applyDataOnCreate (&$object, $objectData, $attribs) | |
prepareInsert (&$object) | |
getType () | |
getObjectDefinition () | |
getSelectSQL ($condStr, $orderStr=null, $attribs=null, $asArray=false) | |
getChildrenSelectSQL ($oid, $compositionOnly=false) | |
getChildrenDisassociateSQL ($oid, $sharedOnly=false) | |
getInsertSQL (&$object) | |
getUpdateSQL (&$object) | |
getDeleteSQL ($oid) | |
createPKCondition ($oid) | |
![]() | |
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 () | |
Additional Inherited Members | |
![]() | |
$_connParams = null | |
$_conn = null | |
$_dbPrefix = '' | |
$_idSelectStmt = null | |
$_idInsertStmt = null | |
$_idUpdateStmt = null | |
![]() | |
$_dataConverter = null | |
$_type = '' | |
$_logging = false | |
$_logStrategy = null | |
NodeUnifiedRDBMapper maps Node objects to a relational database schema where each Node type has its own table. In comparison to NodeRDBMapper it implements almost all template methods from the base classes and defines the sql queries. The newly defined template methods make it easier for application developers to implement own mapper subclasses. The wCMFGenerator uses this class as base class for all mappers. Besides some methods that define table/column names, the main effort lies in implementing the getObjectDefinitionImpl() method wich needs the following extra definitions:
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 52 of file class.NodeUnifiedRDBMapper.php.
NodeUnifiedRDBMapper::initialize | ( | & | $object | ) |
Definition at line 57 of file class.NodeUnifiedRDBMapper.php.
NodeUnifiedRDBMapper::prepareInsert | ( | & | $object | ) |
Definition at line 68 of file class.NodeUnifiedRDBMapper.php.
References PersistenceFacade\decomposeOID(), RDBMapper\getNextId(), getPKColumnNames(), PersistenceFacade\isDummyId(), and isForeignKey().
NodeUnifiedRDBMapper::getObjectDefinition | ( | ) |
Definition at line 93 of file class.NodeUnifiedRDBMapper.php.
References DATATYPE_ATTRIBUTE, and getObjectDefinitionImpl().
Referenced by isAttribute().
NodeUnifiedRDBMapper::getSelectSQL | ( | $condStr, | |
$orderStr = null , |
|||
$attribs = null , |
|||
$asArray = false |
|||
) |
Definition at line 133 of file class.NodeUnifiedRDBMapper.php.
References getObjectDefinitionImpl(), PersistenceMapper\getOrderBy(), getPKColumnNames(), getSQLForRefs(), getTableName(), quote(), StringUtil\removeTrailingComma(), and translateAppToDatabase().
NodeUnifiedRDBMapper::getChildrenSelectSQL | ( | $oid, | |
$compositionOnly = false |
|||
) |
Definition at line 223 of file class.NodeUnifiedRDBMapper.php.
References getObjectDefinitionImpl(), PersistenceFacade\getOIDParameter(), and quote().
NodeUnifiedRDBMapper::getChildrenDisassociateSQL | ( | $oid, | |
$sharedOnly = false |
|||
) |
Definition at line 244 of file class.NodeUnifiedRDBMapper.php.
References getObjectDefinitionImpl(), and PersistenceFacade\getOIDParameter().
NodeUnifiedRDBMapper::getInsertSQL | ( | & | $object | ) |
Definition at line 260 of file class.NodeUnifiedRDBMapper.php.
References PersistenceFacade\decomposeOID(), PersistenceFacade\getInstance(), getMyFKColumnName(), getObjectDefinitionImpl(), getPKColumnNames(), getTableName(), isForeignKey(), PersistenceFacade\isKnownType(), PersistenceFacade\isValidOID(), quote(), and StringUtil\removeTrailingComma().
NodeUnifiedRDBMapper::getUpdateSQL | ( | & | $object | ) |
Definition at line 332 of file class.NodeUnifiedRDBMapper.php.
References createPKCondition(), PersistenceFacade\decomposeOID(), getMyFKColumnName(), getObjectDefinitionImpl(), getTableName(), PersistenceFacade\isKnownType(), PersistenceFacade\isValidOID(), quote(), and StringUtil\removeTrailingComma().
NodeUnifiedRDBMapper::getDeleteSQL | ( | $oid | ) |
Definition at line 388 of file class.NodeUnifiedRDBMapper.php.
References createPKCondition().
NodeUnifiedRDBMapper::createPKCondition | ( | $oid | ) |
Definition at line 402 of file class.NodeUnifiedRDBMapper.php.
References PersistenceFacade\getOIDParameter(), getPKColumnNames(), getTableName(), and quote().
Referenced by getDeleteSQL(), and getUpdateSQL().
NodeUnifiedRDBMapper::isAttribute | ( | $name | ) |
Check if a given name is the name of a value
name | The name to check |
Definition at line 420 of file class.NodeUnifiedRDBMapper.php.
References getObjectDefinition().
NodeUnifiedRDBMapper::isChild | ( | $type, | |
$childDef | |||
) |
Check if a given type is a child type
type | The type to check |
childDef | The child array as defined in the _children key (see NodeRDBMapper::getObjectDefinition()) |
Definition at line 436 of file class.NodeUnifiedRDBMapper.php.
References getChildDef().
NodeUnifiedRDBMapper::getChildDef | ( | $type, | |
$childDef | |||
) |
Get the definition of a given child type
type | The type to get the definition for |
childDef | The child array as defined in the _children key (see NodeRDBMapper::getObjectDefinition()) |
Definition at line 446 of file class.NodeUnifiedRDBMapper.php.
Referenced by getSQLForRefs(), and isChild().
NodeUnifiedRDBMapper::isForeignKey | ( | $column | ) |
Check if a given column is a foreign key (used to reference a parent)
column | The column name |
Definition at line 460 of file class.NodeUnifiedRDBMapper.php.
References getObjectDefinitionImpl().
Referenced by getInsertSQL(), and prepareInsert().
NodeUnifiedRDBMapper::getSQLForRefs | ( | $nodeDef, | |
$attribStr, | |||
$tableStr, | |||
$condStr, | |||
$orderStr, | |||
$attribs = null |
|||
) |
Get the SQL strings for use for the referenced values based on the given strings
nodeDef | The node definition array (see NodeRDBMapper::getObjectDefinition()) |
attribStr | The SQL attribute string to append to |
tableStr | The SQL table string to append to |
condStr | The SQL condition string to append to |
orderStr | The SQL order string to append to |
attribs | The attributes to select or null to select all |
Definition at line 482 of file class.NodeUnifiedRDBMapper.php.
References getChildDef(), getMyFKColumnName(), getPKColumnNames(), getTableName(), quote(), and StringUtil\removeTrailingComma().
Referenced by getSelectSQL().
NodeUnifiedRDBMapper::translateAppToDatabase | ( | $str | ) |
Replace all attribute and type occurences to columns and table name
str | The string to translate (e.g. an orderby clause) |
Definition at line 559 of file class.NodeUnifiedRDBMapper.php.
References getObjectDefinitionImpl(), getTableName(), and RDBMapper\getType().
Referenced by getSelectSQL().
NodeUnifiedRDBMapper::getColumnName | ( | $attributeName, | |
$dataType = null |
|||
) |
Get the name of a column
attributeName | The name of the corresponding attribute |
dataType | The data type of the attribute |
Definition at line 575 of file class.NodeUnifiedRDBMapper.php.
References getObjectDefinitionImpl(), RDBMapper\getType(), and WCMFException\throwEx().
NodeUnifiedRDBMapper::getChildFKColumnName | ( | $childType, | |
$isRequired = true |
|||
) |
Get the name of the foreign key column defined in a given child type that connects from that type to the primary key column of this type.
childType | The child type |
isRequired | True/False wether it is required to find a fk column or not |
Definition at line 601 of file class.NodeUnifiedRDBMapper.php.
References getObjectDefinitionImpl(), and WCMFException\throwEx().
NodeUnifiedRDBMapper::getMyFKColumnName | ( | $parentType, | |
$isRequired = true |
|||
) |
Get the name of the foreign key column defined in this type that connects to the primary key column of a parent type.
parentType | The parent type |
isRequired | True/False wether it is required to find a fk column or not |
Definition at line 621 of file class.NodeUnifiedRDBMapper.php.
References getMyFKColumnNameImpl(), and WCMFException\throwEx().
Referenced by getInsertSQL(), getSQLForRefs(), and getUpdateSQL().
NodeUnifiedRDBMapper::quote | ( | $value | ) |
Quote a value to be inserted into the database
value | The value to quote |
Definition at line 647 of file class.NodeUnifiedRDBMapper.php.
References RDBMapper\getConnection().
Referenced by createPKCondition(), getChildrenSelectSQL(), getInsertSQL(), getSelectSQL(), getSQLForRefs(), and getUpdateSQL().
NodeUnifiedRDBMapper::getPKColumnNames | ( | ) |
Get the names of the primary key database columns of this type
Definition at line 661 of file class.NodeUnifiedRDBMapper.php.
References PersistenceMapper\getPkNames().
Referenced by createPKCondition(), getInsertSQL(), getSelectSQL(), getSQLForRefs(), and prepareInsert().
NodeUnifiedRDBMapper::isValidOID | ( | $oid | ) |
Definition at line 668 of file class.NodeUnifiedRDBMapper.php.
References PersistenceFacade\decomposeOID(), and RDBMapper\getType().
NodeUnifiedRDBMapper::getId | ( | ) |
ChangeListener interface implementation
Definition at line 693 of file class.NodeUnifiedRDBMapper.php.
NodeUnifiedRDBMapper::valueChanged | ( | & | $object, |
$name, | |||
$type, | |||
$oldValue, | |||
$newValue | |||
) |
Definition at line 700 of file class.NodeUnifiedRDBMapper.php.
NodeUnifiedRDBMapper::propertyChanged | ( | & | $object, |
$name, | |||
$oldValue, | |||
$newValue | |||
) |
Definition at line 704 of file class.NodeUnifiedRDBMapper.php.
References PersistenceFacade\decomposeOID(), and getObjectDefinitionImpl().
NodeUnifiedRDBMapper::stateChanged | ( | & | $object, |
$oldValue, | |||
$newValue | |||
) |
Definition at line 726 of file class.NodeUnifiedRDBMapper.php.
NodeUnifiedRDBMapper::getObjectDefinitionImpl | ( | ) |
TEMPLATE METHODS Subclasses must implement this method to define their object type. Implementation of NodeRDBMapper::getObjectDefinition()
Definition at line 747 of file class.NodeUnifiedRDBMapper.php.
References WCMFException\throwEx().
Referenced by getChildFKColumnName(), getChildrenDisassociateSQL(), getChildrenSelectSQL(), getColumnName(), getInsertSQL(), getObjectDefinition(), getSelectSQL(), getUpdateSQL(), isForeignKey(), propertyChanged(), and translateAppToDatabase().
NodeUnifiedRDBMapper::getTableName | ( | ) |
Get the name of the database table, where this type is mapped to
Definition at line 755 of file class.NodeUnifiedRDBMapper.php.
References WCMFException\throwEx().
Referenced by createPKCondition(), getInsertSQL(), getSelectSQL(), getSQLForRefs(), getUpdateSQL(), and translateAppToDatabase().
NodeUnifiedRDBMapper::getMyFKColumnNameImpl | ( | $parentType | ) |
Get the name of the foreign key column defined in this type that connects to the primary key column of a parent type.
parentType | The parent type |
Definition at line 765 of file class.NodeUnifiedRDBMapper.php.
References WCMFException\throwEx().
Referenced by getMyFKColumnName().