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 40 of file NodeUnifiedRDBMapper.php.

+ Inheritance diagram for NodeUnifiedRDBMapper:

Public Member Functions

 getSelectSQL ($criteria=null, $alias=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, Message $message)
 
 __sleep ()
 
 setConnectionParams ($params)
 
 getConnectionParams ()
 
 enableProfiler ()
 
 disableProfiler ()
 
 getProfiler ()
 
 getQuoteIdentifierSymbol ()
 
 quoteIdentifier ($identifier)
 
 quoteValue ($value)
 
 getRealTableName ()
 
 executeSql ($sql, $isSelect=false, $bindValues=array())
 
 executeOperation (PersistenceOperation $operation)
 
 getRelations ($hierarchyType='all')
 
 getRelation ($roleName)
 
 getRelationsByType ($type)
 
 getAttributes (array $tags=array(), $matchMode='all')
 
 getAttribute ($name)
 
 isSortable ($roleName=null)
 
 getSortkey ($roleName=null)
 
 getDefaultOrder ($roleName=null)
 
 renderCriteria (Criteria $criteria, $placeholder=null, $tableName=null, $columnName=null)
 
 getConnection ()
 
 loadObjectsFromSQL (SelectStatement $selectStmt, $buildDepth=BuildDepth::SINGLE, PagingInfo $pagingInfo=null)
 
 beginTransaction ()
 
 commitTransaction ()
 
 rollbackTransaction ()
 
 getSelectSQL ($criteria=null, $alias=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, Message $message)
 
 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 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)
 
 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)
 
 addReferences (SelectStatement $selectStmt, $tableName)
 
 addCriteria (SelectStatement $selectStmt, $criteria, $tableName)
 
 addOrderBy (SelectStatement $selectStmt, $orderby, $tableName, $defaultOrder)
 
 getBind ($criteria, $tableName)
 
 getPersistentValues (PersistentObject $object)
 
 convertValuesForStorage ($values)
 
 loadRelationObjects (PersistentObjectProxy $objectProxy, PersistentObjectProxy $relativeProxy, RDBManyToManyRelationDescription $relationDesc, $includeTransaction=false)
 
 createPKCondition (ObjectId $oid)
 
 getForeignKeyRelations ()
 
 ensureTablePrefix ($expression, $tableName)
 
 getCacheKey ($string, $criteriaArray, $stringArray, PagingInfo $pagingInfo=null)
 
- Protected Member Functions inherited from RDBMapper
 getNextId ()
 
 select (SelectStatement $selectStmt, PagingInfo $pagingInfo=null)
 
 getRelationImpl ($roleName, $includeManyToMany)
 
 getReferences ()
 
 isPkValue ($name)
 
 constructOID ($data)
 
 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)
 
 applyDataOnLoad (PersistentObject $object, array $objectData)
 
 applyDataOnCreate (PersistentObject $object)
 
 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
 
 $_message = null
 

Member Function Documentation

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

Definition at line 49 of file NodeUnifiedRDBMapper.php.

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

Definition at line 207 of file NodeUnifiedRDBMapper.php.

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

Definition at line 253 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 275 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 325 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 375 of file NodeUnifiedRDBMapper.php.

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

Definition at line 442 of file NodeUnifiedRDBMapper.php.

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

Definition at line 457 of file NodeUnifiedRDBMapper.php.

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

Definition at line 475 of file NodeUnifiedRDBMapper.php.

addColumns ( SelectStatement  $selectStmt,
  $tableName 
)
protected

Add the columns to a given select statement.

Parameters
$selectStmtThe select statement (instance of SelectStatement)
$tableNameThe table name
Returns
SelectStatement

Definition at line 493 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 513 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 for bind

Definition at line 576 of file NodeUnifiedRDBMapper.php.

addOrderBy ( SelectStatement  $selectStmt,
  $orderby,
  $tableName,
  $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)
$tableNameThe table name
$defaultOrderThe default order definition to use, if orderby is null (
See also
PersistenceMapper::getDefaultOrder())

Definition at line 606 of file NodeUnifiedRDBMapper.php.

getBind (   $criteria,
  $tableName 
)
protected

Get an array of placeholder value pairs for bind.

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 for bind

Definition at line 631 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 653 of file NodeUnifiedRDBMapper.php.

convertValuesForStorage (   $values)
protected

Convert values for before storage.

Parameters
$valuesAssociative Array
Returns
Associative Array

Definition at line 675 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 700 of file NodeUnifiedRDBMapper.php.

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

Definition at line 739 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 755 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 774 of file NodeUnifiedRDBMapper.php.

ensureTablePrefix (   $expression,
  $tableName 
)
protected

Make sure that the given table name is prefixed before the given expression and return the modified expression.

Parameters
$expressionThe expression
$tableNameThe table name
Returns
String

Definition at line 791 of file NodeUnifiedRDBMapper.php.

getCacheKey (   $string,
  $criteriaArray,
  $stringArray,
PagingInfo  $pagingInfo = null 
)
protected

Get a unique string for the given parameter values.

Parameters
$string
$criteriaArray
$stringArray
$pagingInfo
Returns
String

Definition at line 806 of file NodeUnifiedRDBMapper.php.

Member Data Documentation

const CACHE_KEY = 'mapper'

Definition at line 42 of file NodeUnifiedRDBMapper.php.