Detailed Description

NodeUnifiedRDBMapper maps Node objects to a relational database schema where each Node type has its own table.

The wCMFGenerator uses this class as base class for all mappers.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 41 of file NodeUnifiedRDBMapper.php.

+ Inheritance diagram for NodeUnifiedRDBMapper:

Public Member Functions

 getSelectSQL ($criteria=null, $alias=null, $attributes=null, $orderby=null, PagingInfo $pagingInfo=null, $queryId=null)
 
 isForeignKey ($name)
 
- Public Member Functions inherited from RDBMapper
 __construct (PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ConcurrencyManager $concurrencyManager, EventManager $eventManager)
 
 __sleep ()
 
 setConnectionParams ($params)
 
 getConnectionParams ()
 
 getQuoteIdentifierSymbol ()
 
 quoteIdentifier ($identifier)
 
 quoteValue ($value)
 
 getRealTableName ()
 
 executeSql ($sql, $parameters=[])
 
 select (SelectStatement $selectStmt, PagingInfo $pagingInfo=null)
 
 executeOperation (PersistenceOperation $operation)
 
 getRelations ($hierarchyType='all')
 
 getRelation ($roleName)
 
 getRelationsByType ($type)
 
 getAttributes (array $tags=[], $matchMode='all')
 
 getAttribute ($name)
 
 isSortable ($roleName=null)
 
 getSortkey ($roleName=null)
 
 getDefaultOrder ($roleName=null)
 
 constructOID ($data)
 
 renderCriteria (Criteria $criteria, $placeholder=null, $tableName=null, $columnName=null)
 
 getConnection ()
 
 getAdapter ()
 
 loadObjectsFromSQL (SelectStatement $selectStmt, $buildDepth=BuildDepth::SINGLE, PagingInfo $pagingInfo=null, &$originalData=null)
 
 beginTransaction ()
 
 commitTransaction ()
 
 rollbackTransaction ()
 
 getSelectSQL ($criteria=null, $alias=null, $attributes=null, $orderby=null, PagingInfo $pagingInfo=null, $queryId=null)
 
 isForeignKey ($name)
 
- Public Member Functions inherited from AbstractMapper
 __construct (PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ConcurrencyManager $concurrencyManager, EventManager $eventManager)
 
 setLogStrategy (OutputStrategy $logStrategy)
 
 hasRelation ($roleName)
 
 hasAttribute ($name)
 
 load (ObjectId $oid, $buildDepth=BuildDepth::SINGLE)
 
 create ($type, $buildDepth=BuildDepth::SINGLE)
 
 save (PersistentObject $object)
 
 delete (PersistentObject $object)
 
 getOIDs ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadObjects ($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadRelation (array $objects, $role, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
- Public Member Functions inherited from PersistenceMapper
 getType ()
 
 getTypeDisplayName (Message $message)
 
 getTypeDescription (Message $message)
 
 getPkNames ()
 
 getAttributeDisplayName ($name, Message $message)
 
 getAttributeDescription ($name, Message $message)
 
 getProperties ()
 

Public Attributes

const CACHE_KEY = 'mapper'
 
- Public Attributes inherited from RDBMapper
const SEQUENCE_CLASS = 'DBSequence'
 
const INTERNAL_VALUE_PREFIX = '_mapper_internal_'
 

Protected Member Functions

 prepareForStorage (PersistentObject $object)
 
 getRelationSelectSQL (array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 getManyToOneRelationSelectSQL (RelationDescription $relationDescription, array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 getOneToManyRelationSelectSQL (RelationDescription $relationDescription, array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 getRelationStatement ($thisAttr, $parameters, array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 getManyToManyRelationSelectSQL (RelationDescription $relationDescription, array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 getInsertSQL (PersistentObject $object)
 
 getUpdateSQL (PersistentObject $object)
 
 getDeleteSQL (ObjectId $oid)
 
 addColumns (SelectStatement $selectStmt, $tableName, $attributes=null)
 
 addReferences (SelectStatement $selectStmt, $tableName)
 
 addCriteria (SelectStatement $selectStmt, $criteria, $tableName)
 
 addOrderBy (SelectStatement $selectStmt, $orderby, $orderType, $aliasName, $defaultOrder)
 
 getParameters ($criteria, $tableName)
 
 getPersistentValues (PersistentObject $object)
 
 convertValuesForStorage ($values)
 
 getSortableObject (PersistentObjectProxy $objectProxy, PersistentObjectProxy $relativeProxy, RelationDescription $relationDesc)
 
 loadRelationObjects (PersistentObjectProxy $objectProxy, PersistentObjectProxy $relativeProxy, RDBManyToManyRelationDescription $relationDesc, $includeTransaction=false)
 
 createPKCondition (ObjectId $oid)
 
 getForeignKeyRelations ()
 
 getCacheKey ($alias, $attributeArray, $criteriaArray, $orderArray, PagingInfo $pagingInfo=null)
 
- Protected Member Functions inherited from RDBMapper
 getNextId ()
 
 getRelationImpl ($roleName, $includeManyToMany)
 
 getReferences ()
 
 isPkValue ($name)
 
 loadImpl (ObjectId $oid, $buildDepth=BuildDepth::SINGLE)
 
 createImpl ($type, $buildDepth=BuildDepth::SINGLE)
 
 saveImpl (PersistentObject $object)
 
 deleteImpl (PersistentObject $object)
 
 getOIDsImpl ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadObjectsImpl ($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadObjectsFromQueryParts ($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 createObjectFromData (array $data)
 
 convertValueFromStorage ($valueName, $value)
 
 addRelatedObjects (array $objects, $buildDepth=BuildDepth::SINGLE)
 
 loadRelationImpl (array $objects, $role, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 setIsInTransaction ($isInTransaction)
 
 isInTransaction ()
 
 getOwnDefaultOrder ($roleName=null)
 
 getRelationDescriptions ()
 
 getAttributeDescriptions ()
 
 createObject (ObjectId $oid=null)
 
 prepareForStorage (PersistentObject $object)
 
 getRelationSelectSQL (array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 getInsertSQL (PersistentObject $object)
 
 getUpdateSQL (PersistentObject $object)
 
 getDeleteSQL (ObjectId $oid)
 
 createPKCondition (ObjectId $oid)
 
 getTableName ()
 
- Protected Member Functions inherited from AbstractMapper
 logAction (PersistentObject $obj)
 
 checkAuthorization ($resource, $action)
 
 authorizationFailedError ($resource, $action)
 
 loadImpl (ObjectId $oid, $buildDepth=BuildDepth::SINGLE)
 
 createImpl ($type, $buildDepth=BuildDepth::SINGLE)
 
 saveImpl (PersistentObject $object)
 
 deleteImpl (PersistentObject $object)
 
 getOIDsImpl ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadObjectsImpl ($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadRelationImpl (array $objects, $role, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractMapper
 $persistenceFacade = null
 
 $permissionManager = null
 
 $concurrencyManager = null
 
 $eventManager = null
 

Member Function Documentation

prepareForStorage ( PersistentObject  $object)
protected
See also
RDBMapper::prepareForStorage()

Definition at line 50 of file NodeUnifiedRDBMapper.php.

getSelectSQL (   $criteria = null,
  $alias = null,
  $attributes = null,
  $orderby = null,
PagingInfo  $pagingInfo = null,
  $queryId = null 
)
See also
RDBMapper::getSelectSQL()

Definition at line 232 of file NodeUnifiedRDBMapper.php.

getRelationSelectSQL ( array  $otherObjectProxies,
  $otherRole,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
protected
See also
RDBMapper::getRelationSelectSQL()

Definition at line 279 of file NodeUnifiedRDBMapper.php.

getManyToOneRelationSelectSQL ( RelationDescription  $relationDescription,
array  $otherObjectProxies,
  $otherRole,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
protected

Get the statement for selecting a many-to-one relation.

See also
RDBMapper::getRelationSelectSQL()

Definition at line 301 of file NodeUnifiedRDBMapper.php.

getOneToManyRelationSelectSQL ( RelationDescription  $relationDescription,
array  $otherObjectProxies,
  $otherRole,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
protected

Get the statement for selecting a one-to-many relation.

See also
RDBMapper::getRelationSelectSQL()

Definition at line 328 of file NodeUnifiedRDBMapper.php.

getRelationStatement (   $thisAttr,
  $parameters,
array  $otherObjectProxies,
  $otherRole,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
protected

Get the select statement for a many-to-one or one-to-many relation.

This method is the common part used in both relations.

See also
RDBMapper::getRelationSelectSQL()

Definition at line 357 of file NodeUnifiedRDBMapper.php.

getManyToManyRelationSelectSQL ( RelationDescription  $relationDescription,
array  $otherObjectProxies,
  $otherRole,
  $criteria = null,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
protected

Get the statement for selecting a many-to-many relation.

See also
RDBMapper::getRelationSelectSQL()

Definition at line 393 of file NodeUnifiedRDBMapper.php.

getInsertSQL ( PersistentObject  $object)
protected
See also
RDBMapper::getInsertSQL()

Definition at line 464 of file NodeUnifiedRDBMapper.php.

getUpdateSQL ( PersistentObject  $object)
protected
See also
RDBMapper::getUpdateSQL()

Definition at line 477 of file NodeUnifiedRDBMapper.php.

getDeleteSQL ( ObjectId  $oid)
protected
See also
RDBMapper::getDeleteSQL()

Definition at line 493 of file NodeUnifiedRDBMapper.php.

addColumns ( SelectStatement  $selectStmt,
  $tableName,
  $attributes = null 
)
protected

Add the columns to a given select statement.

Parameters
$selectStmtThe select statement (instance of SelectStatement)
$tableNameThe table name
$attributesArray of attribute names (optional)
Returns
SelectStatement

Definition at line 510 of file NodeUnifiedRDBMapper.php.

addReferences ( SelectStatement  $selectStmt,
  $tableName 
)
protected

Add the columns and joins to select references to a given select statement.

Parameters
$selectStmtThe select statement (instance of SelectStatement)
$tableNameThe name for this table (the alias, if used).
Returns
SelectStatement

Definition at line 533 of file NodeUnifiedRDBMapper.php.

addCriteria ( SelectStatement  $selectStmt,
  $criteria,
  $tableName 
)
protected

Add the given criteria to the select statement.

Parameters
$selectStmtThe select statement (instance of SelectStatement)
$criteriaAn array of Criteria instances that define conditions on the object's attributes (maybe null)
$tableNameThe table name
Returns
Array of placeholder/value pairs

Definition at line 599 of file NodeUnifiedRDBMapper.php.

addOrderBy ( SelectStatement  $selectStmt,
  $orderby,
  $orderType,
  $aliasName,
  $defaultOrder 
)
protected

Add the given order to the select statement.

Parameters
$selectStmtThe select statement (instance of SelectStatement)
$orderbyAn array holding names of attributes to order by, maybe appended with 'ASC', 'DESC' (maybe null)
$orderTypeThe type that define the attributes in orderby (maybe null)
$aliasNameThe table alias name to be used (maybe null)
$defaultOrderThe default order definition to use, if orderby is null (
See also
PersistenceMapper::getDefaultOrder())

Definition at line 634 of file NodeUnifiedRDBMapper.php.

getParameters (   $criteria,
  $tableName 
)
protected

Get an array of placeholder/value pairs.

Parameters
$criteriaAn array of Criteria instances that define conditions on the object's attributes (maybe null)
$tableNameThe table name
Returns
Array of placeholder/value pairs

Definition at line 682 of file NodeUnifiedRDBMapper.php.

getPersistentValues ( PersistentObject  $object)
protected

Get an associative array of attribute name-value pairs to be stored for a given oject (references are not included)

Parameters
$objectThe PeristentObject.
Returns
Associative array

Definition at line 713 of file NodeUnifiedRDBMapper.php.

convertValuesForStorage (   $values)
protected

Convert values before putting into storage.

Parameters
$valuesAssociative Array
Returns
Associative Array

Definition at line 735 of file NodeUnifiedRDBMapper.php.

getSortableObject ( PersistentObjectProxy  $objectProxy,
PersistentObjectProxy  $relativeProxy,
RelationDescription  $relationDesc 
)
protected

Get the object which carries the sortkey in the relation of the given object and relative.

Parameters
PersistentObjectProxy$objectProxy
PersistentObjectProxy$relativeProxy
RelationDescription$relationDescThe relation description
Returns
PersistentObjectProxy

Definition at line 760 of file NodeUnifiedRDBMapper.php.

loadRelationObjects ( PersistentObjectProxy  $objectProxy,
PersistentObjectProxy  $relativeProxy,
RDBManyToManyRelationDescription  $relationDesc,
  $includeTransaction = false 
)
protected

Load the relation objects in a many to many relation from the database.

Parameters
$objectProxyThe proxy at this end of the relation.
$relativeProxyThe proxy at the other end of the relation.
$relationDescThe RDBManyToManyRelationDescription instance describing the relation.
$includeTransactionBoolean whether to also search in the current transaction (default: false)
Returns
Array of PersistentObject instances

Definition at line 778 of file NodeUnifiedRDBMapper.php.

createPKCondition ( ObjectId  $oid)
protected
See also
RDBMapper::createPKCondition()

Definition at line 817 of file NodeUnifiedRDBMapper.php.

getForeignKeyRelations ( )
protected

Get all foreign key relations (used to reference a parent)

Returns
An array of RDBManyToOneRelationDescription instances

Definition at line 833 of file NodeUnifiedRDBMapper.php.

isForeignKey (   $name)

Check if a given attribute is a foreign key (used to reference a parent)

Parameters
$nameThe attribute name
Returns
Boolean
Note
Public in order to be callable by ObjectQuery

Definition at line 852 of file NodeUnifiedRDBMapper.php.

getCacheKey (   $alias,
  $attributeArray,
  $criteriaArray,
  $orderArray,
PagingInfo  $pagingInfo = null 
)
protected

Get a unique string for the given parameter values.

Parameters
$alias
$attributeArray
$criteriaArray
$orderArray
$pagingInfo
Returns
String

Definition at line 871 of file NodeUnifiedRDBMapper.php.

Member Data Documentation

const CACHE_KEY = 'mapper'

Definition at line 43 of file NodeUnifiedRDBMapper.php.