NodeUnifiedRDBMapper.php
233 public function getSelectSQL($criteria=null, $alias=null, $attributes=null, $orderby=null, PagingInfo $pagingInfo=null, $queryId=null) {
235 $queryId = $queryId == null ? $this->getCacheKey($alias, $attributes, $criteria, $orderby, $pagingInfo) : $queryId;
258 $this->addOrderBy($selectStmt, $orderby, $this->getType(), $tableName, $this->getDefaultOrder());
365 $queryId = $this->getCacheKey($otherRole.sizeof($otherObjectProxies), null, $criteria, $orderby, $pagingInfo);
375 $this->addOrderBy($selectStmt, $orderby, $this->getType(), $tableName, $this->getDefaultOrder($otherRole));
423 $queryId = $this->getCacheKey($otherRole.sizeof($otherObjectProxies), null, $criteria, $orderby, $pagingInfo);
434 $joinCond = $nmTableName.'.'.$thisFkAttr->getColumn().'='.$tableName.'.'.$thisIdAttr->getColumn();
437 $this->quoteIdentifier($otherFkAttr->getColumn()).' IN('.join(',', array_keys($parameters)).')');
454 $parameters = array_merge($parameters, $this->addCriteria($selectStmt, $criteria, $nmTableName));
530 if (($attributes == null || in_array($name, $attributes)) && $curAttributeDesc instanceof RDBAttributeDescription) {
555 $relationDesc = sizeof($relationDescs) == 1 ? $relationDescs[0] : $this->getRelation($referencedType);
594 $references[$otherTable]['attributes'][$curReferenceDesc->getName()] = $otherAttributeDesc->getColumn();
609 * @param $criteria An array of Criteria instances that define conditions on the object's attributes (maybe null)
643 * @param $orderby An array holding names of attributes to order by, maybe appended with 'ASC', 'DESC' (maybe null)
646 * @param $defaultOrder The default order definition to use, if orderby is null (@see PersistenceMapper::getDefaultOrder())
648 protected function addOrderBy(SelectStatement $selectStmt, $orderby, $orderType, $aliasName, $defaultOrder) {
692 * @param $criteria An array of Criteria instances that define conditions on the object's attributes (maybe null)
702 list($criteriaCondition, $criteriaPlaceholder) = $this->renderCriteria($criterion, $placeholder, '', '');
789 * @param $includeTransaction Boolean whether to also search in the current transaction (default: false)
885 protected function getCacheKey($alias, $attributeArray, $criteriaArray, $orderArray, PagingInfo $pagingInfo=null) {
DeleteOperation holds data necessary to accomplish an delete operation on the persistent store.
Definition: DeleteOperation.php:21
addCriteria(SelectStatement $selectStmt, $criteria, $tableName)
Add the given criteria to the select statement.
Definition: NodeUnifiedRDBMapper.php:613
AbstractRDBMapper maps objects of one type to a relational database schema.
Definition: AbstractRDBMapper.php:52
wCMF - wemove Content Management Framework Copyright (C) 2005-2020 wemove digital solutions GmbH
Definition: AbstractRDBMapper.php:11
InsertOperation holds data necessary to accomplish an insert operation on the persistent store.
Definition: InsertOperation.php:21
getRelationStatement($thisAttr, $parameters, array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
Get the select statement for a many-to-one or one-to-many relation.
Definition: NodeUnifiedRDBMapper.php:362
Instances of RDBManyToManyRelationDescription describe a many to many relation from 'this' end to 'ot...
Definition: RDBManyToManyRelationDescription.php:26
getRelations($hierarchyType='all')
Definition: AbstractRDBMapper.php:485
getRelationsByType($type)
Definition: AbstractMapper.php:118
static getMapper($type, $strict=true)
Get the mapper for a Node and optionally check if it is a supported one.
Definition: AbstractRDBMapper.php:174
getOneToManyRelationSelectSQL(RelationDescription $relationDescription, array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
Get the statement for selecting a one-to-many relation.
Definition: NodeUnifiedRDBMapper.php:333
UpdateOperation instances hold data necessary to accomplish an update operation on the persistent sto...
Definition: UpdateOperation.php:21
getType()
Get the entity type that this mapper handles.
getDeleteSQL(ObjectId $oid)
Definition: NodeUnifiedRDBMapper.php:507
getDefaultOrder($roleName=null)
Definition: AbstractRDBMapper.php:586
Instances of RDBAttributeDescription describe attributes of PersistentObjects in a relational databas...
Definition: RDBAttributeDescription.php:21
getSortkey($roleName=null)
Definition: AbstractRDBMapper.php:575
Constant expression used in sql statements.
Definition: SQLConst.php:20
getUpdateSQL(PersistentObject $object)
Definition: NodeUnifiedRDBMapper.php:491
getSortableObject(PersistentObjectProxy $objectProxy, PersistentObjectProxy $relativeProxy, RelationDescription $relationDesc)
Get the object which carries the sortkey in the relation of the given object and relative.
Definition: NodeUnifiedRDBMapper.php:774
getReferences()
Definition: AbstractMapper.php:147
getThisEndRelation()
Get the RDBOneToManyRelationDescription describing the relation between 'this' end and the connecting...
Definition: RDBManyToManyRelationDescription.php:47
Instances of RDBManyToOneRelationDescription describe a many to one relation from 'this' end (many) t...
Definition: RDBManyToOneRelationDescription.php:21
getAttribute($name)
Definition: AbstractMapper.php:137
getOtherEndRelation()
Get the RDBManyToOneRelationDescription describing the relation between the connecting type and the '...
Definition: RDBManyToManyRelationDescription.php:56
getPkNames()
Get the names of the primary key values.
getSelectSQL($criteria=null, $alias=null, $attributes=null, $orderby=null, PagingInfo $pagingInfo=null, $queryId=null)
Definition: NodeUnifiedRDBMapper.php:233
getManyToManyRelationSelectSQL(RelationDescription $relationDescription, array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
Get the statement for selecting a many-to-many relation.
Definition: NodeUnifiedRDBMapper.php:402
IllegalArgumentException signals an exception in method arguments.
Definition: IllegalArgumentException.php:18
getRelation($roleName)
Definition: AbstractMapper.php:108
const CACHE_KEY
Definition: NodeUnifiedRDBMapper.php:44
renderCriteria(Criteria $criteria, $placeholder=null, $tableName=null, $columnName=null)
Definition: AbstractRDBMapper.php:635
addReferences(SelectStatement $selectStmt, $tableName)
Add the columns and joins to select references to a given select statement.
Definition: NodeUnifiedRDBMapper.php:547
setState($state)
Set the state of the object to one of the STATE constants.
setValue($name, $value, $forceSet=false, $trackChange=true)
Set the value of an attribute if it exists.
Criteria defines a condition on a PersistentObject's attribute used to select specific instances.
Definition: Criteria.php:21
Instances of RelationDescription describe relations between different types of PersistentObjects.
Definition: RelationDescription.php:21
getManyToOneRelationSelectSQL(RelationDescription $relationDescription, array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
Get the statement for selecting a many-to-one relation.
Definition: NodeUnifiedRDBMapper.php:306
ObjectId is the unique identifier of an object.
Definition: ObjectId.php:28
getRealTableName()
Definition: AbstractRDBMapper.php:359
BuildDepth values are used to define the depth when loading object trees.
Definition: BuildDepth.php:19
loadRelationObjects(PersistentObjectProxy $objectProxy, PersistentObjectProxy $relativeProxy, RDBManyToManyRelationDescription $relationDesc, $includeTransaction=false)
Load the relation objects in a many to many relation from the database.
Definition: NodeUnifiedRDBMapper.php:792
NodeUnifiedRDBMapper maps Node objects to a relational database schema where each Node type has its o...
Definition: NodeUnifiedRDBMapper.php:42
Instances of ReferenceDescription describe reference attributes of PersistentObjects.
Definition: ReferenceDescription.php:21
join($name, $on, $columns=self::SQL_STAR, $type=self::JOIN_INNER)
Definition: SelectStatement.php:217
getParameters($criteria, $tableName)
Get an array of placeholder/value pairs.
Definition: NodeUnifiedRDBMapper.php:696
prepareForStorage(PersistentObject $object)
Definition: NodeUnifiedRDBMapper.php:51
getInsertSQL(PersistentObject $object)
Definition: NodeUnifiedRDBMapper.php:478
getPersistentValues(PersistentObject $object)
Get an associative array of attribute name-value pairs to be stored for a given oject (references are...
Definition: NodeUnifiedRDBMapper.php:727
isForeignKey($name)
Check if a given attribute is a foreign key (used to reference a parent)
Definition: NodeUnifiedRDBMapper.php:866
convertValuesForStorage($values)
Convert values before putting into storage.
Definition: NodeUnifiedRDBMapper.php:749
Instances of RDBOneToManyRelationDescription describe a one to many relation from 'this' end (one) to...
Definition: RDBOneToManyRelationDescription.php:21
getAttributes(array $tags=[], $matchMode='all')
Definition: AbstractRDBMapper.php:540
getRelationSelectSQL(array $otherObjectProxies, $otherRole, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
Definition: NodeUnifiedRDBMapper.php:284
quoteIdentifier($identifier)
Definition: AbstractRDBMapper.php:339
PersistentObjectProxy is proxy for an PersistentObject instance.
Definition: PersistentObjectProxy.php:24
PagingInfo contains information about a paged list.
Definition: PagingInfo.php:18
PersistentObject defines the interface of all persistent objects.
Definition: PersistentObject.php:23
static isValid($oid)
Check if a serialized ObjectId has a valid syntax, the type is known and if the number of primary key...
Definition: ObjectId.php:123
static get(RDBMapper $mapper, $id=self::NO_CACHE)
Get the SelectStatement instance with the given id.
Definition: SelectStatement.php:48
isSortable($roleName=null)
Definition: AbstractRDBMapper.php:568
static fromObject($object)
Create a PersistenceProxy instance from a PersistentObject.
Definition: PersistentObjectProxy.php:44
addOrderBy(SelectStatement $selectStmt, $orderby, $orderType, $aliasName, $defaultOrder)
Add the given order to the select statement.
Definition: NodeUnifiedRDBMapper.php:648
Instances of TransientAttributeDescription describe transient attributes of PersistentObjects.
Definition: TransientAttributeDescription.php:18
getForeignKeyRelations()
Get all foreign key relations (used to reference a parent)
Definition: NodeUnifiedRDBMapper.php:847
getRelationIncludingNM($roleName)
Implementation of PersistenceMapper::getRelation() including nm classes in many to many relations.
Definition: AbstractRDBMapper.php:496
createPKCondition(ObjectId $oid)
Definition: NodeUnifiedRDBMapper.php:831
addColumns(SelectStatement $selectStmt, $tableName, $attributes=null)
Add the columns to a given select statement.
Definition: NodeUnifiedRDBMapper.php:524
getCacheKey($alias, $attributeArray, $criteriaArray, $orderArray, PagingInfo $pagingInfo=null)
Get a unique string for the given parameter values.
Definition: NodeUnifiedRDBMapper.php:885