Commit ac8aad91 authored by Jochen Rau's avatar Jochen Rau
Browse files

[!!!][~API] Extbase (Persistence): $query->execute() now returns a plain array...

[!!!][~API] Extbase (Persistence): $query->execute() now returns a plain array of row-arrays instead of an RowIterator. This is a breaking change if you use your own Query object in combination with $querySettings->getRawQueryResult = TRUE.
[~TASK] Extbase (Persistence): Refactored persistence layer (part I). Dropped QueryObjectModel. The Query-Object is now passed directly to the StorageBackend.
[+API] Extbase (Persistence): Implemented methods in() and contains() in the Query-Object. Resolves #6707.
[+FEATURE] Extbase (Persistence): It is now possible to ask contains() for mm-relations, e.g. $query->contains('categories', $category). Resolves #4679.
parent 9c5dd735
......@@ -262,10 +262,10 @@ class Tx_Extbase_Dispatcher {
$dataMapper->injectIdentityMap($identityMap);
$dataMapper->injectSession($persistenceSession);
$dataMapper->injectReflectionService(self::$reflectionService);
$storageBackend = t3lib_div::makeInstance('Tx_Extbase_Persistence_Storage_Typo3DbBackend', $GLOBALS['TYPO3_DB']); // singleton
$storageBackend->injectDataMapper($dataMapper);
$qomFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_QueryObjectModelFactory', $storageBackend);
$dataMapper->setQomFactory($qomFactory);
......
......@@ -36,6 +36,13 @@
*/
interface Tx_Extbase_DomainObject_DomainObjectInterface {
/**
* Getter for uid.
*
* @return int the uid or NULL if none set yet.
*/
public function getUid();
/**
* Register an object's clean state, e.g. after it has been reconstituted
* from the database
......
......@@ -221,6 +221,28 @@ class Tx_Extbase_Persistence_Backend implements Tx_Extbase_Persistence_BackendIn
return $this->reflectionService;
}
/**
* Returns the number of records matching the query.
*
* @param Tx_Extbase_Persistence_QueryInterface $query
* @return integer
* @api
*/
public function getObjectCountByQuery(Tx_Extbase_Persistence_QueryInterface $query) {
return $this->storageBackend->getObjectCountByQuery($query);
}
/**
* Returns the object data matching the $query.
*
* @param Tx_Extbase_Persistence_QueryInterface $query
* @return array
* @api
*/
public function getObjectDataByQuery(Tx_Extbase_Persistence_QueryInterface $query) {
return $this->storageBackend->getObjectDataByQuery($query);
}
/**
* Returns the (internal) identifier for the object, if it is known to the
* backend. Otherwise NULL is returned.
......@@ -553,10 +575,9 @@ class Tx_Extbase_Persistence_Backend implements Tx_Extbase_Persistence_BackendIn
$columnMap = $this->dataMapper->getDataMap($className)->getColumnMap($propertyName);
$query = $this->queryFactory->create($className);
$query->getQuerySettings()->setReturnRawQueryResult(TRUE);
$result = $query->matching($query->withUid($object->getUid()))->execute();
$rows = $result->getRows();
$currentRow = current(current($rows));
$fieldValue = $currentRow->getValue($columnMap->getColumnName());
$rows = $query->matching($query->withUid($object->getUid()))->execute();
$currentRow = current($rows);
$fieldValue = $currentRow[$columnMap->getColumnName()];
return $fieldValue;
}
......
......@@ -124,6 +124,28 @@ class Tx_Extbase_Persistence_Manager implements Tx_Extbase_Persistence_ManagerIn
public function getRepositoryClassNames() {
return $this->repositoryClassNames;
}
/**
* Returns the number of records matching the query.
*
* @param Tx_Extbase_Persistence_QueryInterface $query
* @return integer
* @api
*/
public function getObjectCountByQuery(Tx_Extbase_Persistence_QueryInterface $query) {
return $this->backend->getObjectCountByQuery($query);
}
/**
* Returns the object data matching the $query.
*
* @param Tx_Extbase_Persistence_QueryInterface $query
* @return array
* @api
*/
public function getObjectDataByQuery(Tx_Extbase_Persistence_QueryInterface $query) {
return $this->backend->getObjectDataByQuery($query);
}
/**
* Commits new objects and changes to objects in the current persistence
......
......@@ -132,7 +132,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
* @param Tx_Extbase_Persistence_RowIteratorInterface $rows
* @return array
*/
public function map($className, Tx_Extbase_Persistence_RowIteratorInterface $rows) {
public function map($className, ARRAY $rows) {
$objects = array();
foreach ($rows as $row) {
$objects[] = $this->mapSingleRow($className, $row);
......@@ -146,12 +146,12 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
* @param Tx_Extbase_Persistence_RowInterface $node
* @return object
*/
protected function mapSingleRow($className, Tx_Extbase_Persistence_RowInterface $row) {
if ($this->identityMap->hasIdentifier($row->getValue('uid'), $className)) {
$object = $this->identityMap->getObjectByIdentifier($row->getValue('uid'), $className);
protected function mapSingleRow($className, array $row) {
if ($this->identityMap->hasIdentifier($row['uid'], $className)) {
$object = $this->identityMap->getObjectByIdentifier($row['uid'], $className);
} else {
$object = $this->createEmptyObject($className);
$this->identityMap->registerObject($object, $row->getValue('uid'));
$this->identityMap->registerObject($object, $row['uid']);
$this->thawProperties($object, $row);
$object->_memorizeCleanState();
$this->persistenceSession->registerReconstitutedObject($object);
......@@ -180,16 +180,16 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
* @param Tx_Extbase_Persistence_RowInterface $row
* @return void
*/
protected function thawProperties(Tx_Extbase_DomainObject_DomainObjectInterface $object, Tx_Extbase_Persistence_RowInterface $row) {
protected function thawProperties(Tx_Extbase_DomainObject_DomainObjectInterface $object, array $row) {
$className = get_class($object);
$dataMap = $this->getDataMap($className);
$properties = $object->_getProperties();
$localizedUid = $row->getValue('_LOCALIZED_UID');
$localizedUid = $row['_LOCALIZED_UID'];
if ($localizedUid !== NULL) {
$object->_setProperty('uid', $localizedUid);
$object->_setProperty('_localizationParentUid', $row->getValue('uid'));
$object->_setProperty('_localizationParentUid', $row['uid']);
} else {
$object->_setProperty('uid', $row->getValue('uid'));
$object->_setProperty('uid', $row['uid']);
}
unset($properties['uid']);
foreach ($properties as $propertyName => $propertyValue) {
......@@ -211,15 +211,15 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
case Tx_Extbase_Persistence_PropertyType::LONG;
case Tx_Extbase_Persistence_PropertyType::DOUBLE;
case Tx_Extbase_Persistence_PropertyType::BOOLEAN;
if ($row->hasValue($columnName)) {
$rawPropertyValue = $row->getValue($columnName);
if (isset($row[$columnName])) {
$rawPropertyValue = $row[$columnName];
$propertyValue = $dataMap->convertFieldValueToPropertyValue($propertyType, $rawPropertyValue);
}
break;
case (Tx_Extbase_Persistence_PropertyType::REFERENCE):
$propertyValue = $row->getValue($columnName);
$propertyValue = $row[$columnName];
if (!is_null($propertyValue)) {
$fieldValue = $row->getValue($columnName);
$fieldValue = $row[$columnName];
$result = $this->fetchRelated($object, $propertyName, $fieldValue);
$propertyValue = $this->mapResultToPropertyValue($object, $propertyName, $result);
}
......@@ -308,7 +308,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
if (isset($parentKeyFieldName)) {
$query->matching($query->equals($parentKeyFieldName, $parentObject->getUid()));
} else {
$query->matching($query->equals('uid', t3lib_div::intExplode(',', $fieldValue)));
$query->matching($query->in('uid', t3lib_div::intExplode(',', $fieldValue)));
}
} elseif ($columnMap->getTypeOfRelation() === Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
$query = $queryFactory->create($this->getElementType($parentObject, $propertyName));
......@@ -324,7 +324,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
$source = $this->qomFactory->join(
$left,
$right,
Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_INNER,
Tx_Extbase_Persistence_QueryInterface::JCR_JOIN_TYPE_INNER,
$joinCondition
);
......
......@@ -86,7 +86,7 @@ class Tx_Extbase_Persistence_QOM_Comparison implements Tx_Extbase_Persistence_QO
protected $operator;
/**
* @var Tx_Extbase_Persistence_QOM_StaticOperandInterface
* @var mixed
*/
protected $operand2;
......@@ -94,25 +94,15 @@ class Tx_Extbase_Persistence_QOM_Comparison implements Tx_Extbase_Persistence_QO
* Constructs this Comparison instance
*
* @param Tx_Extbase_Persistence_QOM_DynamicOperandInterface $operand1
* @param unknown_type $operator
* @param Tx_Extbase_Persistence_QOM_StaticOperandInterface $operand2
* @param int $operator one of Tx_Extbase_Persistence_QueryInterface.OPERATOR_*
* @param mixed $operand2
*/
public function __construct(Tx_Extbase_Persistence_QOM_DynamicOperandInterface $operand1, $operator, Tx_Extbase_Persistence_QOM_StaticOperandInterface $operand2) {
public function __construct(Tx_Extbase_Persistence_QOM_DynamicOperandInterface $operand1, $operator, $operand2) {
$this->operand1 = $operand1;
$this->operator = $operator;
$this->operand2 = $operand2;
}
/**
* Fills an array with the names of all bound variables in the operand
*
* @param array &$boundVariables
* @return void
*/
public function collectBoundVariableNames(&$boundVariables) {
$this->operand2->collectBoundVariablenames($boundVariables);
}
/**
*
* Gets the first operand.
......@@ -135,7 +125,7 @@ class Tx_Extbase_Persistence_QOM_Comparison implements Tx_Extbase_Persistence_QO
/**
* Gets the second operand.
*
* @return Tx_Extbase_Persistence_QOM_StaticOperandInterface the operand; non-null
* @return mixed the operand; non-null
*/
public function getOperand2() {
return $this->operand2;
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
* All rights reserved
*
* This class is a backport of the corresponding class of FLOW3.
* All credits go to the v5 team.
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Base class for constraints in the QOM.
*
* @version $Id: Constraint.php 3616 2010-01-13 16:30:32Z k-fish $
* @api
* @scope prototype
*/
class Constraint {}
?>
\ No newline at end of file
......@@ -130,46 +130,6 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModelFactory implements Tx_Extbase_P
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_EquiJoinCondition', $selector1Name, $property1Name, $selector2Name, $property2Name);
}
/**
* Tests whether a first selector's node is the same as a node identified by relative path from a second selector's node.
*
* @param string $selector1Name the name of the first selector; non-null
* @param string $selector2Name the name of the second selector; non-null
* @param string $selector2Path the path relative to the second selector; non-null
* @return Tx_Extbase_Persistence_QOM_SameNodeJoinConditionInterface the constraint; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function sameNodeJoinCondition($selector1Name, $selector2Name, $selector2Path = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058190);
}
/**
* Tests whether a first selector's node is a child of a second selector's node.
*
* @param string $childSelectorName the name of the child selector; non-null
* @param string $parentSelectorName the name of the parent selector; non-null
* @return Tx_Extbase_Persistence_QOM_ChildNodeJoinConditionInterface the constraint; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function childNodeJoinCondition($childSelectorName, $parentSelectorName) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058190);
}
/**
* Tests whether a first selector's node is a descendant of a second selector's node.
*
* @param string $descendantSelectorName the name of the descendant selector; non-null
* @param string $ancestorSelectorName the name of the ancestor selector; non-null
* @return Tx_Extbase_Persistence_QOM_DescendantNodeJoinConditionInterface the constraint; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function descendantNodeJoinCondition($descendantSelectorName, $ancestorSelectorName) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058192);
}
/**
* Performs a logical conjunction of two other constraints.
*
......@@ -207,18 +167,7 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModelFactory implements Tx_Extbase_P
public function not(Tx_Extbase_Persistence_QOM_ConstraintInterface $constraint) {
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_LogicalNot', $constraint);
}
/**
* Filters related node-tuples based on an object property.
*
* @param Tx_Extbase_DomainObject_AbstractEntity $object The object
* @param string $propertyName The name of the property of the related object
* @return Tx_Extbase_Persistence_QOM_RelatedInterface the constraint; non-null
*/
public function related(Tx_Extbase_DomainObject_AbstractEntity $object, $propertyName) {
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_Related', $object, $propertyName);
}
/**
* Filters node-tuples based on the outcome of a binary operation.
*
......@@ -229,76 +178,10 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModelFactory implements Tx_Extbase_P
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function comparison(Tx_Extbase_Persistence_QOM_DynamicOperandInterface $operand1, $operator, Tx_Extbase_Persistence_QOM_StaticOperandInterface $operand2) {
public function comparison(Tx_Extbase_Persistence_QOM_DynamicOperandInterface $operand1, $operator, $operand2) {
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_Comparison', $operand1, $operator, $operand2);
}
/**
* Tests the existence of a property in the specified or default selector.
*
* @param string $propertyName the property name; non-null
* @param string $selectorName the selector name; non-null
* @return Tx_Extbase_Persistence_QOM_PropertyExistenceInterface the constraint; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function propertyExistence($propertyName, $selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058196);
}
/**
* Performs a full-text search against the specified or default selector.
*
* @param string $propertyName the property name, or null to search all full-text indexed properties of the node (or node subgraph, in some implementations);
* @param string $fullTextSearchExpression the full-text search expression; non-null
* @param string $selectorName the selector name; non-null
* @return Tx_Extbase_Persistence_QOM_FullTextSearchInterface the constraint; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function fullTextSearch($propertyName, $fullTextSearchExpression, $selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058197);
}
/**
* Tests whether a node in the specified or default selector is reachable by a specified absolute path.
*
* @param string $selectorName the selector name; non-null
* @param string $path an absolute path; non-null
* @return Tx_Extbase_Persistence_QOM_SameNodeInterface the constraint; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function sameNode($path, $selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058198);
}
/**
* Tests whether a node in the specified or default selector is a child of a node reachable by a specified absolute path.
*
* @param string $path an absolute path; non-null
* @param string $selectorName the selector name; non-null
* @return Tx_Extbase_Persistence_QOM_ChildNodeInterface the constraint; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function childNode($path, $selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058199);
}
/**
* Tests whether a node in the specified or default selector is a descendant of a node reachable by a specified absolute path.
*
* @param string $path an absolute path; non-null
* @param string $selectorName the selector name; non-null
* @return Tx_Extbase_Persistence_QOM_DescendantNodeInterface the constraint; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function descendantNode($path, $selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058200);
}
/**
* Evaluates to the value (or values, if multi-valued) of a property in the specified or default selector.
*
......@@ -311,55 +194,7 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModelFactory implements Tx_Extbase_P
public function propertyValue($propertyName, $selectorName = '') {
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_PropertyValue', $propertyName, $selectorName);
}
/**
* Evaluates to the length (or lengths, if multi-valued) of a property.
*
* @param Tx_Extbase_Persistence_QOM_PropertyValueInterface $propertyValue the property value for which to compute the length; non-null
* @return Tx_Extbase_Persistence_QOM_LengthInterface the operand; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function length(Tx_Extbase_Persistence_QOM_PropertyValueInterface $propertyValue) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058202);
}
/**
* Evaluates to a NAME value equal to the prefix-qualified name of a node in the specified or default selector.
*
* @param string $selectorName the selector name; non-null
* @return Tx_Extbase_Persistence_QOM_NodeNameInterface the operand; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function nodeName($selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058203);
}
/**
* Evaluates to a NAME value equal to the local (unprefixed) name of a node in the specified or default selector.
*
* @param string $selectorName the selector name; non-null
* @return Tx_Extbase_Persistence_QOM_NodeLocalNameInterface the operand; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function nodeLocalName($selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058204);
}
/**
* Evaluates to a DOUBLE value equal to the full-text search score of a node in the specified or default selector.
*
* @param string $selectorName the selector name; non-null
* @return Tx_Extbase_Persistence_QOM_FullTextSearchScoreInterface the operand; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function fullTextSearchScore($selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058205);
}
/**
* Evaluates to the lower-case string value (or values, if multi-valued) of an operand.
*
......@@ -383,33 +218,7 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModelFactory implements Tx_Extbase_P
public function upperCase(Tx_Extbase_Persistence_QOM_DynamicOperandInterface $operand) {
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_UpperCase', $operand);
}
/**
* Evaluates to the value of a bind variable.
*
* @param string $bindVariableName the bind variable name; non-null
* @return Tx_Extbase_Persistence_QOM_BindVariableValueInterface the operand; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function bindVariable($bindVariableName) {
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_BindVariableValue', $bindVariableName);
}
/**
* Evaluates to a literal value.
*
* The query is invalid if no value is bound to $literalValue.
*
* @param \F3\PHPCR\ValueInterface $literalValue the value
* @return \F3\PHPCR\ValueInterface the operand; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if a particular validity test is possible on this method, the implemention chooses to perform that test (and not leave it until later) on createQuery, and the parameters given fail that test
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function literal(Tx_Extbase_Persistence_ValueInterface $literalValue) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058209);
}
/**
* Orders by the value of the specified operand, in ascending order.
*
......@@ -437,36 +246,18 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModelFactory implements Tx_Extbase_P
public function descending(Tx_Extbase_Persistence_QOM_DynamicOperandInterface $operand) {
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_Ordering', $operand, Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_ORDER_DESCENDING);
}
/**
* Identifies a property in the specified or default selector to include in
* the tabular view of query results.
* The column name is the property name if not given.
*
* The query is invalid if:
* $selectorName is not the name of a selector in the query, or
* $propertyName is specified but it is not a syntactically valid JCR name, or
* $propertyName is specified but does not evaluate to a scalar value, or
* $propertyName is specified but $columnName is omitted, or
* $propertyName is omitted but $columnName is specified, or
* the columns in the tabular view are not uniquely named, whether those
* column names are specified by $columnName (if $propertyName is specified)
* or generated as described above (if $propertyName is omitted).
*
* If $propertyName is specified but, for a node-tuple, the selector node
* does not have a property named $propertyName, the query is valid and the
* column has null value.
* Evaluates to the value of a bind variable.
*
* @param string $propertyName the property name, or null to include a column for each single-value non-residual property of the selector's node type
* @param string $columnName the column name; must be null if propertyName is null
* @param string $selectorName the selector name; non-null
* @return Tx_Extbase_Persistence_QOM_ColumnInterface the column; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query has no default selector or is otherwise invalid
* @param string $bindVariableName the bind variable name; non-null
* @return Tx_Extbase_Persistence_QOM_BindVariableValueInterface the operand; non-null
* @throws \F3\PHPCR\Query\InvalidQueryException if the query is invalid
* @throws Tx_Extbase_Persistence_Exception_RepositoryException if the operation otherwise fails
*/
public function column($propertyName, $columnName = NULL, $selectorName = NULL) {
throw new Tx_Extbase_Persistence_Exception('Method not yet implemented, sorry!', 1217058211);
public function bindVariable($bindVariableName) {
return t3lib_div::makeInstance('Tx_Extbase_Persistence_QOM_BindVariableValue', $bindVariableName);
}
}
?>
......@@ -47,19 +47,19 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
protected $dataMapper;
/**
* @var Tx_Extbase_Persistence_QOM_QueryObjectModelFactoryInterface
* @var Tx_Extbase_Persistence_Manager
*/
protected $QOMFactory;
protected $persistenceManager;
/**
* @var Tx_Extbase_Persistence_ValueFactoryInterface
* @var Tx_Extbase_Persistence_QOM_QueryObjectModelFactoryInterface
*/
protected $valueFactory;
protected $qomFactory;
/**
* @var Tx_Extbase_Persistence_ManagerInterface
* @var Tx_Extbase_Persistence_ValueFactoryInterface
*/
protected $persistenceManager;
protected $valueFactory;
/**
* @var Tx_Extbase_Persistence_QOM_SourceInterface
......@@ -121,7 +121,7 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
*/
public function injectPersistenceManager(Tx_Extbase_Persistence_ManagerInterface $persistenceManager) {
$this->persistenceManager = $persistenceManager;
$this->QOMFactory = $this->persistenceManager->getBackend()->getQOMFactory();
$this->qomFactory = $this->persistenceManager->getBackend()->getQomFactory();
$this->valueFactory = $this->persistenceManager->getBackend()->getValueFactory();
}
......@@ -148,11 +148,11 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf