[CLEANUP] Extbase persistence classes 89/28489/35
authorMarkus Klein <klein.t3@mfc-linz.at>
Fri, 21 Mar 2014 01:48:41 +0000 (02:48 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 25 Mar 2014 01:47:25 +0000 (02:47 +0100)
The classes contain wrong type hints and miss a lot of
checks whether the correct object is present.

Resolves: #57031
Releases: 6.2
Change-Id: I3d03c838b05529daf0da444119dd7f8dba6d5b8a
Reviewed-on: https://review.typo3.org/28489
Reviewed-by: Felix Oertel
Tested-by: Felix Oertel
Reviewed-by: Markus Klein
Tested-by: Markus Klein
58 files changed:
typo3/sysext/core/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php
typo3/sysext/extbase/Classes/DomainObject/DomainObjectInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
typo3/sysext/extbase/Classes/Persistence/Generic/BackendInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/LazyObjectStorage.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMap.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php
typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php
typo3/sysext/extbase/Classes/Persistence/Generic/PersistenceManager.php
typo3/sysext/extbase/Classes/Persistence/Generic/PropertyType.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/BindVariableValue.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Comparison.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/ComparisonInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Constraint.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/ConstraintInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/DynamicOperand.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/DynamicOperandInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/EquiJoinCondition.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/EquiJoinConditionInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Join.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/JoinConditionInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/JoinInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/LogicalAnd.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/LogicalNot.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/LogicalOr.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/LowerCase.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/LowerCaseInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/NotInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Operand.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/OrInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Ordering.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/OrderingInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/PropertyValue.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/PropertyValueInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/QueryObjectModelFactory.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/QueryObjectModelFactoryInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Selector.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/SelectorInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Statement.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/StaticOperand.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/StaticOperandInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/UpperCase.php
typo3/sysext/extbase/Classes/Persistence/Generic/Qom/UpperCaseInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Query.php
typo3/sysext/extbase/Classes/Persistence/Generic/QueryFactory.php
typo3/sysext/extbase/Classes/Persistence/Generic/QueryResult.php
typo3/sysext/extbase/Classes/Persistence/Generic/QuerySettingsInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Session.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/BackendInterface.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbQueryParser.php
typo3/sysext/extbase/Classes/Persistence/Generic/Typo3QuerySettings.php
typo3/sysext/extbase/Classes/Persistence/ObjectStorage.php
typo3/sysext/extbase/Classes/Persistence/PersistenceManagerInterface.php
typo3/sysext/extbase/Classes/Persistence/QueryInterface.php
typo3/sysext/extbase/Classes/Persistence/Repository.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/QueryTest.php

index a3f5ad1..70df36d 100644 (file)
@@ -2284,11 +2284,6 @@ interface Tx_Extbase_Persistence_QOM_ComparisonInterface extends \TYPO3\CMS\Extb
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class Tx_Extbase_Persistence_QOM_Constraint extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Constraint {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 interface Tx_Extbase_Persistence_QOM_ConstraintInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface {}
 
 /**
index f32d5c8..7b9337a 100644 (file)
@@ -243,7 +243,7 @@ abstract class AbstractDomainObject implements \TYPO3\CMS\Extbase\DomainObject\D
         * Returns the clean value of the given property. The returned value will be NULL if the clean state was not memorized before, or
         * if the clean value is NULL.
         *
-        * @param string $propertyName The name of the property to be memorized. If omittet all persistable properties are memorized.
+        * @param string $propertyName The name of the property to be memorized.
         * @return mixed The clean property value or NULL
         */
        public function _getCleanProperty($propertyName) {
index 11be259..f9e18b5 100644 (file)
@@ -89,4 +89,31 @@ interface DomainObjectInterface {
         * @return array The properties
         */
        public function _getProperties();
+
+       /**
+        * Returns the clean value of the given property. The returned value will be NULL if the clean state was not memorized before, or
+        * if the clean value is NULL.
+        *
+        * @param string $propertyName The name of the property to be memorized.
+        * @return mixed The clean property value or NULL
+        */
+       public function _getCleanProperty($propertyName);
+
+       /**
+        * Returns TRUE if the properties were modified after reconstitution
+        *
+        * @param string $propertyName An optional name of a property to be checked if its value is dirty
+        * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\TooDirtyException
+        * @return boolean
+        */
+       public function _isDirty($propertyName = NULL);
+
+       /**
+        * Register an object's clean state, e.g. after it has been reconstituted
+        * from the database.
+        *
+        * @param string $propertyName The name of the property to be memorized. If omitted all persistable properties are memorized.
+        * @return void
+        */
+       public function _memorizeCleanState($propertyName = NULL);
 }
index 00ce33c..db5e239 100644 (file)
@@ -28,6 +28,8 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic;
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
+use TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface;
+
 /**
  * A persistence backend. This backend maps objects to the relational model of the storage backend.
  * It persists all added, removed and changed objects.
@@ -111,7 +113,6 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
         * Constructs the backend
         *
         * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
-        * @return void
         */
        public function __construct(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
                $this->configurationManager = $configurationManager;
@@ -316,6 +317,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
        protected function persistObjects() {
                $this->visitedDuringPersistence = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
                foreach ($this->aggregateRootObjects as $object) {
+                       /** @var DomainObjectInterface $object */
                        if ($object->_isNew()) {
                                $this->insertObject($object);
                        }
@@ -426,6 +428,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
                $updateSortingOfFollowing = FALSE;
 
                foreach ($objectStorage as $object) {
+                       /** @var DomainObjectInterface $object */
                        if (empty($currentUids)) {
                                $sortingPosition = 1;
                        } else {
@@ -507,7 +510,7 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
         * Updates the fields defining the relation between the object and the parent object.
         *
         * @param \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object
-        * @param \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject
+        * @param \TYPO3\CMS\Extbase\DomainObject\AbstractEntity $parentObject
         * @param string $parentPropertyName
         * @param integer $sortingPosition
         * @return void
@@ -1015,5 +1018,6 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
                } else {
                        return $input;
                }
+               return NULL;
        }
 }
index b45fd33..f8d0dcf 100644 (file)
@@ -101,4 +101,21 @@ interface BackendInterface {
         */
        public function isNewObject($object);
 
+       /**
+        * Returns the number of records matching the query.
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @return integer
+        * @api
+        */
+       public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
+
+       /**
+        * Returns the object data matching the $query.
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @return array
+        * @api
+        */
+       public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
 }
index f5d6258..1c14f29 100644 (file)
@@ -166,7 +166,7 @@ class LazyObjectStorage extends \TYPO3\CMS\Extbase\Persistence\ObjectStorage imp
        public function count() {
                $columnMap = $this->dataMapper->getDataMap(get_class($this->parentObject))->getColumnMap($this->propertyName);
                $numberOfElements = NULL;
-               if (!$this->isInitialized && $columnMap->getTypeOfRelation() === \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::RELATION_HAS_MANY) {
+               if (!$this->isInitialized && $columnMap->getTypeOfRelation() === Mapper\ColumnMap::RELATION_HAS_MANY) {
                        $numberOfElements = $this->dataMapper->countRelated($this->parentObject, $this->propertyName, $this->fieldValue);
                } else {
                        $this->initialize();
index 56e3145..3fd5f5a 100644 (file)
@@ -234,7 +234,7 @@ class DataMap {
         * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap $columnMap The column map
         * @return void
         */
-       public function addColumnMap(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap $columnMap) {
+       public function addColumnMap(ColumnMap $columnMap) {
                $this->columnMaps[$columnMap->getPropertyName()] = $columnMap;
        }
 
index 443de0f..625420b 100644 (file)
@@ -27,7 +27,6 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Mapper;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap;
 
 /**
  * A factory for a data map to map a single table configured in $TCA on a domain object.
index 0e43130..c663d9e 100644 (file)
@@ -27,7 +27,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Mapper;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-use TYPO3\CMS\Core\Type\TypeInterface;
+
 use TYPO3\CMS\Extbase\Utility\TypeHandlingUtility;
 
 /**
@@ -473,6 +473,7 @@ class DataMapper implements \TYPO3\CMS\Core\SingletonInterface {
         * @return mixed
         */
        public function mapResultToPropertyValue(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject, $propertyName, $result) {
+               $propertyValue = NULL;
                if ($result instanceof \TYPO3\CMS\Extbase\Persistence\Generic\LoadingStrategyInterface) {
                        $propertyValue = $result;
                } else {
index 2a7075d..b6ae31c 100644 (file)
@@ -27,6 +27,9 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
+use TYPO3\CMS\Extbase\Persistence\QueryInterface;
+
 /**
  * The Extbase Persistence Manager
  *
@@ -40,17 +43,17 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
        protected $newObjects = array();
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+        * @var ObjectStorage
         */
        protected $changedObjects;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+        * @var ObjectStorage
         */
        protected $addedObjects;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+        * @var ObjectStorage
         */
        protected $removedObjects;
 
@@ -76,9 +79,9 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
         * Create new instance
         */
        public function __construct() {
-               $this->addedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->removedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->changedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+               $this->addedObjects = new ObjectStorage();
+               $this->removedObjects = new ObjectStorage();
+               $this->changedObjects = new ObjectStorage();
        }
 
        /**
@@ -94,22 +97,22 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
        /**
         * Returns the number of records matching the query.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @param QueryInterface $query
         * @return integer
         * @api
         */
-       public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query) {
+       public function getObjectCountByQuery(QueryInterface $query) {
                return $this->backend->getObjectCountByQuery($query);
        }
 
        /**
         * Returns the object data matching the $query.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @param QueryInterface $query
         * @return array
         * @api
         */
-       public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query) {
+       public function getObjectDataByQuery(QueryInterface $query) {
                return $this->backend->getObjectDataByQuery($query);
        }
 
@@ -167,16 +170,16 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
                $this->backend->setDeletedEntities($this->removedObjects);
                $this->backend->commit();
 
-               $this->addedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->removedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->changedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+               $this->addedObjects = new ObjectStorage();
+               $this->removedObjects = new ObjectStorage();
+               $this->changedObjects = new ObjectStorage();
        }
 
        /**
         * Return a query object for the given type.
         *
         * @param string $type
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
+        * @return QueryInterface
         */
        public function createQueryForType($type) {
                return $this->queryFactory->create($type);
@@ -256,9 +259,9 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
         */
        public function clearState() {
                $this->newObjects = array();
-               $this->addedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->removedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->changedObjects = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+               $this->addedObjects = new ObjectStorage();
+               $this->removedObjects = new ObjectStorage();
+               $this->changedObjects = new ObjectStorage();
                $this->persistenceSession->destroy();
        }
 
@@ -295,6 +298,7 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
         *
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\NotImplementedException
         * @param object $object The object to be converted
+        * @return array
         * @api
         */
        public function convertObjectToIdentityArray($object) {
@@ -307,6 +311,7 @@ class PersistenceManager implements \TYPO3\CMS\Extbase\Persistence\PersistenceMa
         *
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\NotImplementedException
         * @param array $array The array to be iterated over
+        * @return array
         * @api
         * @see convertObjectToIdentityArray()
         */
index 73b2a77..f1db9f5 100644 (file)
@@ -215,8 +215,6 @@ class PropertyType {
 
        /**
         * Make instantiation impossible...
-        *
-        * @return void
         */
        private function __construct() {
        }
@@ -354,8 +352,6 @@ class PropertyType {
                        case 'double':
                                $value = \TYPO3\CMS\Extbase\Persistence\Generic\PropertyType::DOUBLE;
                                break;
-                       case 'integer':
-
                        case 'int':
                                $value = \TYPO3\CMS\Extbase\Persistence\Generic\PropertyType::INTEGER;
                                break;
index 3e1ef6b..616f71a 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
 /**
  * Evaluates to the value of a bind variable.
  */
-class BindVariableValue extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\StaticOperand implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\BindVariableValueInterface {
+class BindVariableValue implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\BindVariableValueInterface {
 
        /**
         * @var string
index 0ffa587..21c5b3a 100644 (file)
@@ -27,6 +27,8 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extbase\Persistence\QueryInterface;
+
 /**
  * Filters node-tuples based on the outcome of a binary operation.
  *
@@ -70,10 +72,10 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * the string "\x" matches the character "x", and
  * all other characters match themselves.
  */
-class Comparison implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface {
+class Comparison implements ComparisonInterface {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface
+        * @var PropertyValueInterface
         */
        protected $operand1;
 
@@ -87,7 +89,7 @@ class Comparison implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Compariso
         */
        protected $operand2;
 
-       /*
+       /**
         * @var string
         */
        protected $parameterIdentifier;
@@ -95,11 +97,11 @@ class Comparison implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Compariso
        /**
         * Constructs this Comparison instance
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand1
-        * @param integer $operator one of \TYPO3\CMS\Extbase\Persistence\QueryInterface.OPERATOR_*
+        * @param PropertyValueInterface $operand1
+        * @param integer $operator one of QueryInterface::OPERATOR_*
         * @param mixed $operand2
         */
-       public function __construct(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand1, $operator, $operand2) {
+       public function __construct(PropertyValueInterface $operand1, $operator, $operand2) {
                $this->operand1 = $operand1;
                $this->operator = $operator;
                $this->operand2 = $operand2;
@@ -108,7 +110,7 @@ class Comparison implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Compariso
        /**
         * Gets the first operand.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface the operand; non-null
+        * @return PropertyValueInterface the operand; non-null
         */
        public function getOperand1() {
                return $this->operand1;
@@ -117,16 +119,16 @@ class Comparison implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Compariso
        /**
         * Gets the operator.
         *
-        * @return string one of \TYPO3\CMS\Extbase\Persistence\QueryInterface.OPERATOR_*
+        * @return string One of QueryInterface::OPERATOR_*
         */
        public function getOperator() {
                $operator = $this->operator;
 
                if ($this->getOperand2() === NULL) {
-                       if ($operator === \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_EQUAL_TO) {
-                               $operator = \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_EQUAL_TO_NULL;
-                       } elseif ($operator === \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_NOT_EQUAL_TO) {
-                               $operator = \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_NOT_EQUAL_TO_NULL;
+                       if ($operator === QueryInterface::OPERATOR_EQUAL_TO) {
+                               $operator = QueryInterface::OPERATOR_EQUAL_TO_NULL;
+                       } elseif ($operator === QueryInterface::OPERATOR_NOT_EQUAL_TO) {
+                               $operator = QueryInterface::OPERATOR_NOT_EQUAL_TO_NULL;
                        }
                }
 
@@ -156,4 +158,13 @@ class Comparison implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Compariso
        public function getParameterIdentifier() {
                return $this->parameterIdentifier;
        }
+
+       /**
+        * Fills an array with the names of all bound variables in the constraints
+        *
+        * @param array &$boundVariables
+        * @return void
+        */
+       public function collectBoundVariableNames(&$boundVariables) {
+       }
 }
index 41488d1..ee3b68d 100644 (file)
@@ -72,26 +72,37 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  *
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  */
-interface ComparisonInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface {
+interface ComparisonInterface extends ConstraintInterface {
 
        /**
         * Gets the first operand.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface the operand; non-null
+        * @return PropertyValueInterface the operand; non-null
         */
        public function getOperand1();
 
        /**
         * Gets the operator.
         *
-        * @return string one of \TYPO3\CMS\Extbase\Persistence\QueryObjectModelConstantsInterface.OPERATOR_*
+        * @return string one of \TYPO3\CMS\Extbase\Persistence\QueryInterface::*
         */
        public function getOperator();
 
        /**
         * Gets the second operand.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\StaticOperandInterface the operand; non-null
+        * @return StaticOperandInterface the operand; non-null
         */
        public function getOperand2();
+
+       /**
+        * @param string $parameterIdentifier
+        * @return void
+        */
+       public function setParameterIdentifier($parameterIdentifier);
+
+       /**
+        * @return string
+        */
+       public function getParameterIdentifier();
 }
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Constraint.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Constraint.php
deleted file mode 100644 (file)
index 2cbe45b..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010-2013 Extbase Team (http://forge.typo3.org/projects/typo3v4-mvc)
- *  Extbase is a backport of TYPO3 Flow. All credits go to the TYPO3 Flow team.
- *  All rights reserved
- *
- *  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.
- *  A copy is found in the text file GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  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.
- *
- * @api
- */
-class Constraint implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface {
-
-}
index 9354573..ca25eab 100644 (file)
@@ -35,4 +35,11 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  */
 interface ConstraintInterface {
 
+       /**
+        * Fills an array with the names of all bound variables in the constraints
+        *
+        * @param array &$boundVariables
+        * @return void
+        */
+       public function collectBoundVariableNames(&$boundVariables);
 }
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/DynamicOperand.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/DynamicOperand.php
deleted file mode 100644 (file)
index 0a22d84..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010-2013 Extbase Team (http://forge.typo3.org/projects/typo3v4-mvc)
- *  Extbase is a backport of TYPO3 Flow. All credits go to the TYPO3 Flow team.
- *  All rights reserved
- *
- *  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.
- *  A copy is found in the text file GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  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!
- ***************************************************************/
-/**
- * An operand whose value can only be determined in evaluating the query.
- */
-class DynamicOperand extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Operand implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface {
-
-}
index de64a5f..9b5bdfe 100644 (file)
@@ -30,6 +30,6 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
 /**
  * An operand whose value can only be determined in evaluating the query.
  */
-interface DynamicOperandInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OperandInterface {
+interface DynamicOperandInterface extends OperandInterface {
 
 }
index 5b3ec66..0cff933 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * the selector2Name node has a property named property2Name, and
  * the value of property property1Name is equal to the value of property property2Name.
  */
-class EquiJoinCondition implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinConditionInterface {
+class EquiJoinCondition implements EquiJoinConditionInterface {
 
        /**
         * @var string
@@ -107,4 +107,22 @@ class EquiJoinCondition implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Jo
        public function getProperty2Name() {
                return $this->property2Name;
        }
+
+       /**
+        * Gets the name of the child selector.
+        *
+        * @return string the selector name; non-null
+        */
+       public function getChildSelectorName() {
+               return '';
+       }
+
+       /**
+        * Gets the name of the parent selector.
+        *
+        * @return string the selector name; non-null
+        */
+       public function getParentSelectorName() {
+               return '';
+       }
 }
index 92c775f..1d37b3d 100644 (file)
@@ -34,7 +34,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * would return true, where childSelectorNode is the node for childSelector and
  * parentSelectorNode is the node for parentSelector.
  */
-interface EquiJoinConditionInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinConditionInterface {
+interface EquiJoinConditionInterface extends JoinConditionInterface {
 
        /**
         * Gets the name of the child selector.
index 28bb4ec..95f971a 100644 (file)
@@ -30,15 +30,15 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
 /**
  * Performs a join between two node-tuple sources.
  */
-class Join implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface {
+class Join implements JoinInterface {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface
+        * @var SourceInterface
         */
        protected $left;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface
+        * @var SourceInterface
         */
        protected $right;
 
@@ -48,19 +48,19 @@ class Join implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface {
        protected $joinType;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinConditionInterface
+        * @var JoinConditionInterface
         */
        protected $joinCondition;
 
        /**
         * Constructs the Join instance
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $left the left node-tuple source; non-null
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $right the right node-tuple source; non-null
-        * @param string $joinType one of QueryObjectModelConstants.JCR_JOIN_TYPE_*
+        * @param SourceInterface $left the left node-tuple source; non-null
+        * @param SourceInterface $right the right node-tuple source; non-null
+        * @param string $joinType One of Query::JCR_JOIN_TYPE_*
         * @param JoinConditionInterface $joinCondition
         */
-       public function __construct(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $left, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $right, $joinType, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinConditionInterface $joinCondition) {
+       public function __construct(SourceInterface $left, SourceInterface $right, $joinType, JoinConditionInterface $joinCondition) {
                $this->left = $left;
                $this->right = $right;
                $this->joinType = $joinType;
@@ -70,7 +70,7 @@ class Join implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface {
        /**
         * Gets the left node-tuple source.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface the left source; non-null
+        * @return SourceInterface the left source; non-null
         */
        public function getLeft() {
                return $this->left;
@@ -79,7 +79,7 @@ class Join implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface {
        /**
         * Gets the right node-tuple source.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface the right source; non-null
+        * @return SourceInterface the right source; non-null
         */
        public function getRight() {
                return $this->right;
index c470c0d..b9082c4 100644 (file)
@@ -32,4 +32,10 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  */
 interface JoinConditionInterface {
 
+       /**
+        * Gets the name of the first selector.
+        *
+        * @return string the selector name; non-null
+        */
+       public function getSelector1Name();
 }
index 69990d1..0eeedbc 100644 (file)
@@ -30,19 +30,19 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
 /**
  * Performs a join between two node-tuple sources.
  */
-interface JoinInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface {
+interface JoinInterface extends SourceInterface {
 
        /**
         * Gets the left node-tuple source.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface the left source; non-null
+        * @return SelectorInterface the left source; non-null
         */
        public function getLeft();
 
        /**
         * Gets the right node-tuple source.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface the right source; non-null
+        * @return SelectorInterface the right source; non-null
         */
        public function getRight();
 
index b0f978b..eed5b91 100644 (file)
@@ -33,23 +33,23 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * To satisfy the And constraint, a node-tuple must satisfy both constraint1 and
  * constraint2.
  */
-class LogicalAnd implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface {
+class LogicalAnd implements AndInterface {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface
+        * @var ConstraintInterface
         */
        protected $constraint1;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface
+        * @var ConstraintInterface
         */
        protected $constraint2;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint1
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint2
+        * @param ConstraintInterface $constraint1
+        * @param ConstraintInterface $constraint2
         */
-       public function __construct(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint1, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint2) {
+       public function __construct(ConstraintInterface $constraint1, ConstraintInterface $constraint2) {
                $this->constraint1 = $constraint1;
                $this->constraint2 = $constraint2;
        }
@@ -68,7 +68,7 @@ class LogicalAnd implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterf
        /**
         * Gets the first constraint.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface the constraint; non-null
+        * @return ConstraintInterface the constraint; non-null
         */
        public function getConstraint1() {
                return $this->constraint1;
@@ -77,7 +77,7 @@ class LogicalAnd implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterf
        /**
         * Gets the second constraint.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface the constraint; non-null
+        * @return ConstraintInterface the constraint; non-null
         */
        public function getConstraint2() {
                return $this->constraint2;
index 3431903..fc46c5c 100644 (file)
@@ -32,17 +32,17 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  *
  * To satisfy the Not constraint, the node-tuple must not satisfy constraint.
  */
-class LogicalNot implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface {
+class LogicalNot implements NotInterface {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface
+        * @var ConstraintInterface
         */
        protected $constraint;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint
+        * @param ConstraintInterface $constraint
         */
-       public function __construct(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint) {
+       public function __construct(ConstraintInterface $constraint) {
                $this->constraint = $constraint;
        }
 
@@ -59,7 +59,7 @@ class LogicalNot implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterf
        /**
         * Gets the constraint negated by this Not constraint.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface the constraint; non-null
+        * @return ConstraintInterface the constraint; non-null
         */
        public function getConstraint() {
                return $this->constraint;
index 133cc6d..4d0ec19 100644 (file)
@@ -35,23 +35,23 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * satisfy constraint2 but not constraint1, or
  * satisfy both constraint1 and constraint2.
  */
-class LogicalOr implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface {
+class LogicalOr implements OrInterface {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface
+        * @var ConstraintInterface
         */
        protected $constraint1;
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface
+        * @var ConstraintInterface
         */
        protected $constraint2;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint1
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint2
+        * @param ConstraintInterface $constraint1
+        * @param ConstraintInterface $constraint2
         */
-       public function __construct(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint1, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint2) {
+       public function __construct(ConstraintInterface $constraint1, ConstraintInterface $constraint2) {
                $this->constraint1 = $constraint1;
                $this->constraint2 = $constraint2;
        }
@@ -70,7 +70,7 @@ class LogicalOr implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterfac
        /**
         * Gets the first constraint.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface the constraint; non-null
+        * @return ConstraintInterface the constraint; non-null
         */
        public function getConstraint1() {
                return $this->constraint1;
@@ -79,7 +79,7 @@ class LogicalOr implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterfac
        /**
         * Gets the second constraint.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface the constraint; non-null
+        * @return ConstraintInterface the constraint; non-null
         */
        public function getConstraint2() {
                return $this->constraint2;
index cf2a3dc..a2384fd 100644 (file)
@@ -36,10 +36,10 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  *
  * If operand evaluates to null, the LowerCase operand also evaluates to null.
  */
-class LowerCase implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\LowerCaseInterface {
+class LowerCase implements LowerCaseInterface {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface
+        * @var DynamicOperandInterface
         */
        protected $operand;
 
@@ -48,14 +48,14 @@ class LowerCase implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\LowerCaseI
         *
         * @param DynamicOperandInterface $operand
         */
-       public function __construct(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand) {
+       public function __construct(DynamicOperandInterface $operand) {
                $this->operand = $operand;
        }
 
        /**
         * Gets the operand whose value is converted to a lower-case string.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface the operand; non-null
+        * @return DynamicOperandInterface the operand; non-null
         */
        public function getOperand() {
                return $this->operand;
index 0cf0e7a..fdd9e86 100644 (file)
@@ -36,12 +36,12 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  *
  * If operand evaluates to null, the LowerCase operand also evaluates to null.
  */
-interface LowerCaseInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface {
+interface LowerCaseInterface extends DynamicOperandInterface {
 
        /**
         * Gets the operand whose value is converted to a lower-case string.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface the operand; non-null
+        * @return DynamicOperandInterface the operand; non-null
         */
        public function getOperand();
 }
index f75265d..388f616 100644 (file)
@@ -32,12 +32,12 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  *
  * To satisfy the Not constraint, the node-tuple must not satisfy constraint.
  */
-interface NotInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface {
+interface NotInterface extends ConstraintInterface {
 
        /**
         * Gets the constraint negated by this Not constraint.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface the constraint; non-null
+        * @return ConstraintInterface the constraint; non-null
         */
        public function getConstraint();
 }
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Operand.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/Operand.php
deleted file mode 100644 (file)
index 6c70dbe..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010-2013 Extbase Team (http://forge.typo3.org/projects/typo3v4-mvc)
- *  Extbase is a backport of TYPO3 Flow. All credits go to the TYPO3 Flow team.
- *  All rights reserved
- *
- *  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.
- *  A copy is found in the text file GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  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!
- ***************************************************************/
-/**
- * An operand to a binary operation specified by a Comparison.
- */
-class Operand implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OperandInterface {
-
-}
index 1ea6ea3..9894e95 100644 (file)
@@ -35,19 +35,19 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * satisfy constraint2 but not constraint1, or
  * satisfy both constraint1 and constraint2.
  */
-interface OrInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface {
+interface OrInterface extends ConstraintInterface {
 
        /**
         * Gets the first constraint.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface the constraint; non-null
+        * @return ConstraintInterface the constraint; non-null
         */
        public function getConstraint1();
 
        /**
         * Gets the second constraint.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface the constraint; non-null
+        * @return ConstraintInterface the constraint; non-null
         */
        public function getConstraint2();
 }
index 1da2626..6f5c789 100644 (file)
@@ -31,25 +31,25 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * Determines the relative order of two rows in the result set by evaluating operand for
  * each.
  */
-class Ordering implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrderingInterface {
+class Ordering implements OrderingInterface {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface
+        * @var DynamicOperandInterface
         */
        protected $operand;
 
        /**
-        * @var string One of \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_*
+        * @var string One of \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_*
         */
        protected $order;
 
        /**
         * Constructs the Ordering instance
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand The operand; non-null
-        * @param string $order either \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_ASCENDING or \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_DESCENDING
+        * @param DynamicOperandInterface $operand The operand; non-null
+        * @param string $order One of \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_*
         */
-       public function __construct(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand, $order = \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_ASCENDING) {
+       public function __construct(DynamicOperandInterface $operand, $order = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING) {
                $this->operand = $operand;
                $this->order = $order;
        }
@@ -57,7 +57,7 @@ class Ordering implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrderingInt
        /**
         * The operand by which to order.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface the operand; non-null
+        * @return DynamicOperandInterface the operand; non-null
         */
        public function getOperand() {
                return $this->operand;
@@ -66,7 +66,7 @@ class Ordering implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrderingInt
        /**
         * Gets the order.
         *
-        * @return string either \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_ASCENDING or \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_DESCENDING
+        * @return string One of \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_*
         */
        public function getOrder() {
                return $this->order;
index bd8cf84..5ccd748 100644 (file)
@@ -36,14 +36,14 @@ interface OrderingInterface {
        /**
         * The operand by which to order.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface the operand; non-null
+        * @return DynamicOperandInterface the operand; non-null
         */
        public function getOperand();
 
        /**
         * Gets the order.
         *
-        * @return string either \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_ASCENDING or \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_DESCENDING
+        * @return string One of \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_*
         */
        public function getOrder();
 }
index b32748e..6033466 100644 (file)
@@ -38,7 +38,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * selector is not the name of a selector in the query, or
  * property is not a syntactically valid JCR name.
  */
-class PropertyValue extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperand implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\PropertyValueInterface {
+class PropertyValue implements PropertyValueInterface {
 
        /**
         * @var string
index 4ce3764..7f64671 100644 (file)
@@ -38,7 +38,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * selector is not the name of a selector in the query, or
  * property is not a syntactically valid JCR name.
  */
-interface PropertyValueInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface {
+interface PropertyValueInterface extends DynamicOperandInterface {
 
        /**
         * Gets the name of the selector against which to evaluate this operand.
index ccab811..033de28 100644 (file)
@@ -67,13 +67,13 @@ class QueryObjectModelFactory implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Performs a join between two node-tuple sources.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $left the left node-tuple source; non-null
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $right the right node-tuple source; non-null
+        * @param SourceInterface $left the left node-tuple source; non-null
+        * @param SourceInterface $right the right node-tuple source; non-null
         * @param string $joinType one of QueryObjectModelConstants.JCR_JOIN_TYPE_*
         * @param JoinConditionInterface $joinCondition
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface the join; non-null
         */
-       public function join(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $left, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $right, $joinType, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinConditionInterface $joinCondition) {
+       public function join(SourceInterface $left, SourceInterface $right, $joinType, JoinConditionInterface $joinCondition) {
                return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Join', $left, $right, $joinType, $joinCondition);
        }
 
@@ -94,48 +94,48 @@ class QueryObjectModelFactory implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Performs a logical conjunction of two other constraints.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint1 the first constraint; non-null
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint2 the second constraint; non-null
+        * @param ConstraintInterface $constraint1 the first constraint; non-null
+        * @param ConstraintInterface $constraint2 the second constraint; non-null
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface the And constraint; non-null
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
-       public function _and(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint1, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint2) {
+       public function _and(ConstraintInterface $constraint1, ConstraintInterface $constraint2) {
                return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\LogicalAnd', $constraint1, $constraint2);
        }
 
        /**
         * Performs a logical disjunction of two other constraints.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint1 the first constraint; non-null
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint2 the second constraint; non-null
+        * @param ConstraintInterface $constraint1 the first constraint; non-null
+        * @param ConstraintInterface $constraint2 the second constraint; non-null
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface the Or constraint; non-null
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
-       public function _or(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint1, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint2) {
+       public function _or(ConstraintInterface $constraint1, ConstraintInterface $constraint2) {
                return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\LogicalOr', $constraint1, $constraint2);
        }
 
        /**
         * Performs a logical negation of another constraint.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint the constraint to be negated; non-null
+        * @param ConstraintInterface $constraint the constraint to be negated; non-null
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface the Not constraint; non-null
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
-       public function not(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint) {
+       public function not(ConstraintInterface $constraint) {
                return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\LogicalNot', $constraint);
        }
 
        /**
         * Filters node-tuples based on the outcome of a binary operation.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand1 the first operand; non-null
+        * @param DynamicOperandInterface $operand1 the first operand; non-null
         * @param string $operator the operator; one of QueryObjectModelConstants.JCR_OPERATOR_*
         * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\StaticOperandInterface $operand2 the second operand; non-null
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface the constraint; non-null
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
-       public function comparison(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand1, $operator, $operand2) {
+       public function comparison(DynamicOperandInterface $operand1, $operator, $operand2) {
                return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Comparison', $operand1, $operator, $operand2);
        }
 
@@ -154,22 +154,22 @@ class QueryObjectModelFactory implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Evaluates to the lower-case string value (or values, if multi-valued) of an operand.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand the operand whose value is converted to a lower-case string; non-null
+        * @param DynamicOperandInterface $operand the operand whose value is converted to a lower-case string; non-null
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\LowerCaseInterface the operand; non-null
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
-       public function lowerCase(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand) {
+       public function lowerCase(DynamicOperandInterface $operand) {
                return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\LowerCase', $operand);
        }
 
        /**
         * Evaluates to the upper-case string value (or values, if multi-valued) of an operand.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand the operand whose value is converted to a upper-case string; non-null
+        * @param DynamicOperandInterface $operand the operand whose value is converted to a upper-case string; non-null
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\UpperCaseInterface the operand; non-null
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
-       public function upperCase(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand) {
+       public function upperCase(DynamicOperandInterface $operand) {
                return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\UpperCase', $operand);
        }
 
@@ -178,12 +178,12 @@ class QueryObjectModelFactory implements \TYPO3\CMS\Core\SingletonInterface {
         *
         * The query is invalid if $operand does not evaluate to a scalar value.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand the operand by which to order; non-null
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrderingInterface the ordering
+        * @param DynamicOperandInterface $operand the operand by which to order; non-null
+        * @return OrderingInterface the ordering
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
-       public function ascending(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand) {
-               return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Ordering', $operand, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_ASCENDING);
+       public function ascending(DynamicOperandInterface $operand) {
+               return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Ordering', $operand, \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING);
        }
 
        /**
@@ -191,19 +191,19 @@ class QueryObjectModelFactory implements \TYPO3\CMS\Core\SingletonInterface {
         *
         * The query is invalid if $operand does not evaluate to a scalar value.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand the operand by which to order; non-null
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrderingInterface the ordering
+        * @param DynamicOperandInterface $operand the operand by which to order; non-null
+        * @return OrderingInterface the ordering
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
-       public function descending(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand) {
-               return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Ordering', $operand, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_DESCENDING);
+       public function descending(DynamicOperandInterface $operand) {
+               return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Ordering', $operand, \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING);
        }
 
        /**
         * Evaluates to the value of a bind variable.
         *
         * @param string $bindVariableName the bind variable name; non-null
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\BindVariableValueInterface the operand; non-null
+        * @return BindVariableValueInterface the operand; non-null
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException if the operation otherwise fails
         */
        public function bindVariable($bindVariableName) {
index e3cd4e8..67545d1 100644 (file)
@@ -31,7 +31,9 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * A QueryObjectModelFactory creates instances of the JCR query object model.
  *
  * Refer to QueryObjectModelInterface for a description of the query object model.
+ *
+ * @deprecated since Extbase 6.2; no replacement, will be removed two versions later
  */
-interface QueryObjectModelFactoryInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface {
+interface QueryObjectModelFactoryInterface extends QueryObjectModelConstantsInterface {
 
 }
index 3db8e81..f23dc4c 100644 (file)
@@ -38,7 +38,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * the node has a mixin node type that is nodeType, or
  * the node has a mixin node type that is a subtype of nodeType.
  */
-class Selector implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface {
+class Selector implements SelectorInterface {
 
        /**
         * @var string
index 17910f1..2be5a19 100644 (file)
@@ -38,7 +38,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * the node has a mixin node type that is nodeType, or
  * the node has a mixin node type that is a subtype of nodeType.
  */
-interface SelectorInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface {
+interface SelectorInterface extends SourceInterface {
 
        /**
         * Gets the name of the required node type.
index f0bc139..a12c1ee 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
 /**
  * A statement acting as a constraint.
  */
-class Statement {
+class Statement implements ConstraintInterface {
 
        /**
         * @var string|\TYPO3\CMS\Core\Database\PreparedStatement
@@ -79,4 +79,13 @@ class Statement {
        public function getBoundVariables() {
                return $this->boundVariables;
        }
+
+       /**
+        * Fills an array with the names of all bound variables in the constraints
+        *
+        * @param array &$boundVariables
+        * @return void
+        */
+       public function collectBoundVariableNames(&$boundVariables) {
+       }
 }
diff --git a/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/StaticOperand.php b/typo3/sysext/extbase/Classes/Persistence/Generic/Qom/StaticOperand.php
deleted file mode 100644 (file)
index 1980600..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010-2013 Extbase Team (http://forge.typo3.org/projects/typo3v4-mvc)
- *  Extbase is a backport of TYPO3 Flow. All credits go to the TYPO3 Flow team.
- *  All rights reserved
- *
- *  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.
- *  A copy is found in the text file GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  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!
- ***************************************************************/
-/**
- * An operand whose value can be determined from static analysis of the query,
- * prior to its evaluation.
- */
-class StaticOperand extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Operand implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\StaticOperandInterface {
-
-}
index 05a8f9e..e914471 100644 (file)
@@ -31,6 +31,6 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  * An operand whose value can be determined from static analysis of the query,
  * prior to its evaluation.
  */
-interface StaticOperandInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OperandInterface {
+interface StaticOperandInterface extends OperandInterface {
 
 }
index eae09dc..ca1aa55 100644 (file)
@@ -38,10 +38,10 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  *
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  */
-class UpperCase implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\UpperCaseInterface {
+class UpperCase implements UpperCaseInterface {
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface
+        * @var DynamicOperandInterface
         */
        protected $operand;
 
@@ -50,14 +50,14 @@ class UpperCase implements \TYPO3\CMS\Extbase\Persistence\Generic\Qom\UpperCaseI
         *
         * @param DynamicOperandInterface $operand
         */
-       public function __construct(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $operand) {
+       public function __construct(DynamicOperandInterface $operand) {
                $this->operand = $operand;
        }
 
        /**
         * Gets the operand whose value is converted to a upper-case string.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface the operand; non-null
+        * @return DynamicOperandInterface the operand; non-null
         */
        public function getOperand() {
                return $this->operand;
index 5690570..2857dae 100644 (file)
@@ -36,12 +36,12 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Qom;
  *
  * If operand evaluates to null, the UpperCase operand also evaluates to null.
  */
-interface UpperCaseInterface extends \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface {
+interface UpperCaseInterface extends DynamicOperandInterface {
 
        /**
         * Gets the operand whose value is converted to a upper-case string.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface the operand; non-null
+        * @return DynamicOperandInterface the operand; non-null
         */
        public function getOperand();
 }
index c9abe71..964dcb2 100644 (file)
@@ -27,12 +27,14 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extbase\Persistence\QueryInterface;
+
 /**
  * The Query class used to run queries against the database
  *
  * @api
  */
-class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
+class Query implements QueryInterface {
 
        /**
         * An inner join.
@@ -116,7 +118,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
        /**
         * The query settings.
         *
-        * @var \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @var QuerySettingsInterface
         */
        protected $querySettings;
 
@@ -133,11 +135,11 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * Sets the Query Settings. These Query settings must match the settings expected by
         * the specific Storage Backend.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings The Query Settings
+        * @param QuerySettingsInterface $querySettings The Query Settings
         * @return void
         * @api This method is not part of FLOW3 API
         */
-       public function setQuerySettings(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings) {
+       public function setQuerySettings(QuerySettingsInterface $querySettings) {
                $this->querySettings = $querySettings;
        }
 
@@ -145,11 +147,11 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * Returns the Query Settings.
         *
         * @throws Exception
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings The Query Settings
+        * @return QuerySettingsInterface $querySettings The Query Settings
         * @api This method is not part of FLOW3 API
         */
        public function getQuerySettings() {
-               if (!$this->querySettings instanceof \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface) {
+               if (!$this->querySettings instanceof QuerySettingsInterface) {
                        throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception('Tried to get the query settings without seting them before.', 1248689115);
                }
                return $this->querySettings;
@@ -181,8 +183,9 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * @return string The selector name
         */
        protected function getSelectorName() {
-               if ($this->getSource() instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
-                       return $this->source->getSelectorName();
+               $source = $this->getSource();
+               if ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
+                       return $source->getSelectorName();
                } else {
                        return '';
                }
@@ -224,7 +227,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * where 'foo' and 'bar' are property names.
         *
         * @param array $orderings The property names to order by
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
+        * @return QueryInterface
         * @api
         */
        public function setOrderings(array $orderings) {
@@ -252,7 +255,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         *
         * @param integer $limit
         * @throws \InvalidArgumentException
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
+        * @return QueryInterface
         * @api
         */
        public function setLimit($limit) {
@@ -267,7 +270,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * Resets a previously set maximum size of the result set. Returns $this to allow
         * for chaining (fluid interface)
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
+        * @return QueryInterface
         * @api
         */
        public function unsetLimit() {
@@ -291,7 +294,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         *
         * @param integer $offset
         * @throws \InvalidArgumentException
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
+        * @return QueryInterface
         * @api
         */
        public function setOffset($offset) {
@@ -317,7 +320,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * for chaining (fluid interface)
         *
         * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
+        * @return QueryInterface
         * @api
         */
        public function matching($constraint) {
@@ -331,7 +334,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         *
         * @param string|\TYPO3\CMS\Core\Database\PreparedStatement $statement The statement
         * @param array $parameters An array of parameters. These will be bound to placeholders '?' in the $statement.
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
+        * @return QueryInterface
         */
        public function statement($statement, array $parameters = array()) {
                $this->statement = $this->qomFactory->statement($statement, $parameters);
@@ -350,7 +353,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
        /**
         * Gets the constraint for this query.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Constraint the constraint, or null if none
+        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface|NULL the constraint, or null if none
         * @api
         */
        public function getConstraint() {
@@ -411,11 +414,12 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
        /**
         * Performs a logical negation of the given constraint
         *
-        * @param object $constraint Constraint to negate
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint Constraint to negate
+        * @throws \RuntimeException
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface
         * @api
         */
-       public function logicalNot($constraint) {
+       public function logicalNot(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint) {
                return $this->qomFactory->not($constraint);
        }
 
@@ -430,9 +434,17 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         */
        public function equals($propertyName, $operand, $caseSensitive = TRUE) {
                if (is_object($operand) || $caseSensitive) {
-                       $comparison = $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_EQUAL_TO, $operand);
+                       $comparison = $this->qomFactory->comparison(
+                               $this->qomFactory->propertyValue($propertyName, $this->getSelectorName()),
+                               QueryInterface::OPERATOR_EQUAL_TO,
+                               $operand
+                       );
                } else {
-                       $comparison = $this->qomFactory->comparison($this->qomFactory->lowerCase($this->qomFactory->propertyValue($propertyName, $this->getSelectorName())), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_EQUAL_TO, \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Charset\\CharsetConverter')->conv_case(\TYPO3\CMS\Extbase\Persistence\Generic\Query::CHARSET, $operand, 'toLower'));
+                       $comparison = $this->qomFactory->comparison(
+                               $this->qomFactory->lowerCase($this->qomFactory->propertyValue($propertyName, $this->getSelectorName())),
+                               QueryInterface::OPERATOR_EQUAL_TO,
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Charset\\CharsetConverter')->conv_case(\TYPO3\CMS\Extbase\Persistence\Generic\Query::CHARSET, $operand, 'toLower')
+                       );
                }
                return $comparison;
        }
@@ -447,7 +459,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * @api
         */
        public function like($propertyName, $operand, $caseSensitive = TRUE) {
-               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LIKE, $operand);
+               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_LIKE, $operand);
        }
 
        /**
@@ -460,7 +472,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * @api
         */
        public function contains($propertyName, $operand) {
-               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_CONTAINS, $operand);
+               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_CONTAINS, $operand);
        }
 
        /**
@@ -475,9 +487,9 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         */
        public function in($propertyName, $operand) {
                if (!is_array($operand) && !$operand instanceof \ArrayAccess && !$operand instanceof \Traversable) {
-                       throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnexpectedTypeException('The "in" operator must be given a mutlivalued operand (array, ArrayAccess, Traversable).', 1264678095);
+                       throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnexpectedTypeException('The "in" operator must be given a multivalued operand (array, ArrayAccess, Traversable).', 1264678095);
                }
-               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_IN, $operand);
+               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_IN, $operand);
        }
 
        /**
@@ -489,7 +501,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * @api
         */
        public function lessThan($propertyName, $operand) {
-               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LESS_THAN, $operand);
+               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_LESS_THAN, $operand);
        }
 
        /**
@@ -501,7 +513,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * @api
         */
        public function lessThanOrEqual($propertyName, $operand) {
-               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LESS_THAN_OR_EQUAL_TO, $operand);
+               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_LESS_THAN_OR_EQUAL_TO, $operand);
        }
 
        /**
@@ -513,7 +525,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * @api
         */
        public function greaterThan($propertyName, $operand) {
-               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_GREATER_THAN, $operand);
+               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_GREATER_THAN, $operand);
        }
 
        /**
@@ -525,7 +537,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * @api
         */
        public function greaterThanOrEqual($propertyName, $operand) {
-               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO, $operand);
+               return $this->qomFactory->comparison($this->qomFactory->propertyValue($propertyName, $this->getSelectorName()), QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO, $operand);
        }
 
        /**
@@ -562,6 +574,7 @@ class Query implements \TYPO3\CMS\Extbase\Persistence\QueryInterface {
         * @param string $propertyName The name of the multivalued property to compare against
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\NotImplementedException
         * @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException if used on a single-valued property
+        * @return bool
         * @api
         */
        public function isEmpty($propertyName) {
index 2681504..13ff3b1 100644 (file)
@@ -30,7 +30,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic;
 /**
  * The QueryFactory used to create queries against the storage backend
  */
-class QueryFactory implements \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface, \TYPO3\CMS\Core\SingletonInterface {
+class QueryFactory implements QueryFactoryInterface, \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
index 4b67942..c752d9b 100644 (file)
@@ -27,12 +27,14 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
+
 /**
  * A lazy result list that is returned by Query::execute()
  *
  * @api
  */
-class QueryResult implements \TYPO3\CMS\Extbase\Persistence\QueryResultInterface {
+class QueryResult implements QueryResultInterface {
 
        /**
         * This field is only needed to make debugging easier:
index b288955..fedd007 100644 (file)
@@ -192,4 +192,14 @@ interface QuerySettingsInterface {
         * @deprecated since Extbase 6.2, will be removed two versions later
         */
        public function getReturnRawQueryResult();
+
+       /**
+        * @return bool
+        */
+       public function getUseQueryCache();
+
+       /**
+        * @return bool
+        */
+       public function getUsePreparedStatement();
 }
index a6fe423..05d0ce8 100644 (file)
@@ -27,6 +27,8 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
+
 /**
  * The persistence session - acts as a Unit of Work for Extbase persistence framework.
  */
@@ -35,7 +37,7 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Reconstituted objects
         *
-        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+        * @var ObjectStorage
         */
        protected $reconstitutedEntities;
 
@@ -49,7 +51,7 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
        protected $reconstitutedEntitiesData = array();
 
        /**
-        * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+        * @var ObjectStorage
         */
        protected $objectMap;
 
@@ -68,8 +70,8 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
         * Constructs a new Session
         */
        public function __construct() {
-               $this->reconstitutedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->objectMap = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+               $this->reconstitutedEntities = new ObjectStorage();
+               $this->objectMap = new ObjectStorage();
        }
 
        /**
@@ -115,7 +117,7 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Returns all objects which have been registered as reconstituted
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage All reconstituted objects
+        * @return ObjectStorage All reconstituted objects
         */
        public function getReconstitutedEntities() {
                return $this->reconstitutedEntities;
@@ -198,7 +200,7 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Unregister an object
         *
-        * @param string $object
+        * @param object $object
         * @return void
         */
        public function unregisterObject($object) {
@@ -214,8 +216,8 @@ class Session implements \TYPO3\CMS\Core\SingletonInterface {
         */
        public function destroy() {
                $this->identifierMap = array();
-               $this->objectMap = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
-               $this->reconstitutedEntities = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
+               $this->objectMap = new ObjectStorage();
+               $this->reconstitutedEntities = new ObjectStorage();
                $this->reconstitutedEntitiesData = array();
        }
 
index 3ce7e07..a478d84 100644 (file)
@@ -98,4 +98,13 @@ interface BackendInterface {
         * @api
         */
        public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
+
+       /**
+        * Checks if a Value Object equal to the given Object exists in the data base
+        *
+        * @param \TYPO3\CMS\Extbase\DomainObject\AbstractValueObject $object The Value Object
+        * @return mixed The matching uid if an object was found, else FALSE
+        * @todo this is the last monster in this persistence series. refactor!
+        */
+       public function getUidOfAlreadyPersistedValueObject(\TYPO3\CMS\Extbase\DomainObject\AbstractValueObject $object);
 }
index 8e7eece..cd8dc93 100644 (file)
@@ -29,12 +29,13 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Storage;
  ***************************************************************/
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement;
 use TYPO3\CMS\Extbase\Persistence\QueryInterface;
 
 /**
  * A Storage backend
  */
-class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface, \TYPO3\CMS\Core\SingletonInterface {
+class Typo3DbBackend implements BackendInterface, \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * The TYPO3 database object
@@ -283,12 +284,12 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        /**
         * Returns the object data matching the $query.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @param QueryInterface $query
         * @return array
         */
-       public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query) {
+       public function getObjectDataByQuery(QueryInterface $query) {
                $statement = $query->getStatement();
-               if ($statement instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement) {
+               if ($statement instanceof Statement) {
                        $rows = $this->getObjectDataByRawQuery($statement);
                } else {
                        $rows = $this->getRowsByStatementParts($query);
@@ -323,10 +324,10 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        /**
         * Determines whether to use prepared statement or not and returns the rows from the corresponding method
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @param QueryInterface $query
         * @return array
         */
-       protected function getRowsByStatementParts(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query) {
+       protected function getRowsByStatementParts(QueryInterface $query) {
                if ($query->getQuerySettings()->getUsePreparedStatement()) {
                        list($statementParts, $parameters) = $this->getStatementParts($query, FALSE);
                        $rows = $this->getRowsFromPreparedDatabase($statementParts, $parameters);
@@ -387,10 +388,10 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        /**
         * Returns the object data using a custom statement
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement $statement
+        * @param Statement $statement
         * @return array
         */
-       protected function getObjectDataByRawQuery(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement $statement) {
+       protected function getObjectDataByRawQuery(Statement $statement) {
                $realStatement = $statement->getStatement();
                $parameters = $statement->getBoundVariables();
 
@@ -426,13 +427,13 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        /**
         * Returns the number of tuples matching the query.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @param QueryInterface $query
         * @throws Exception\BadConstraintException
         * @return integer The number of matching tuples
         */
-       public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query) {
-               if ($query->getConstraint() instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement) {
-                       throw new \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\BadConstraintException('Could not execute count on queries with a constraint of type TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\StatementInterface', 1256661045);
+       public function getObjectCountByQuery(QueryInterface $query) {
+               if ($query->getConstraint() instanceof Statement) {
+                       throw new \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\BadConstraintException('Could not execute count on queries with a constraint of type TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\Statement', 1256661045);
                }
 
                list($statementParts) = $this->getStatementParts($query);
@@ -464,57 +465,56 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        /**
         * Looks for the query in cache or builds it up otherwise
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @param QueryInterface $query
         * @param bool $resolveParameterPlaceholders whether to resolve the parameters or leave the placeholders
         * @return array
-        * @throws \Exception
+        * @throws \RuntimeException
         */
        protected function getStatementParts($query, $resolveParameterPlaceholders = TRUE) {
-                       /**
-                        * The queryParser will preparse the query to get the query's hash and parameters.
-                        * If the hash is found in the cache and useQueryCaching is enabled, extbase will
-                        * then take the string representation from cache and build a prepared query with
-                        * the parameters found.
-                        *
-                        * Otherwise extbase will parse the complete query, build the string representation
-                        * and run a usual query.
-                        */
-                       list($queryHash, $parameters) = $this->queryParser->preparseQuery($query);
-
-                       if ($query->getQuerySettings()->getUseQueryCache()) {
-                               $statementParts = $this->queryCache->get($queryHash);
-
-                               if ($queryHash && !$statementParts) {
-                                       $statementParts = $this->queryParser->parseQuery($query);
-                                       $this->queryCache->set($queryHash, $statementParts, array(), 0);
-                               }
-                       } else {
+               /**
+                * The queryParser will preparse the query to get the query's hash and parameters.
+                * If the hash is found in the cache and useQueryCaching is enabled, extbase will
+                * then take the string representation from cache and build a prepared query with
+                * the parameters found.
+                *
+                * Otherwise extbase will parse the complete query, build the string representation
+                * and run a usual query.
+                */
+               list($queryHash, $parameters) = $this->queryParser->preparseQuery($query);
+
+               if ($query->getQuerySettings()->getUseQueryCache()) {
+                       $statementParts = $this->queryCache->get($queryHash);
+                       if ($queryHash && !$statementParts) {
                                $statementParts = $this->queryParser->parseQuery($query);
+                               $this->queryCache->set($queryHash, $statementParts, array(), 0);
                        }
+               } else {
+                       $statementParts = $this->queryParser->parseQuery($query);
+               }
 
-                       if (!$statementParts) {
-                               throw new \Exception('Your query could not be built.', 1394453197);
-                       }
+               if (!$statementParts) {
+                       throw new \RuntimeException('Your query could not be built.', 1394453197);
+               }
 
-                       // Limit and offset are not cached to allow caching of pagebrowser queries.
-                       $statementParts['limit'] = ((int)$query->getLimit() ?: NULL);
-                       $statementParts['offset'] = ((int)$query->getOffset() ?: NULL);
+               // Limit and offset are not cached to allow caching of pagebrowser queries.
+               $statementParts['limit'] = ((int)$query->getLimit() ?: NULL);
+               $statementParts['offset'] = ((int)$query->getOffset() ?: NULL);
 
-                       if ($resolveParameterPlaceholders === TRUE) {
-                               $statementParts = $this->resolveParameterPlaceholders($statementParts, $parameters);
-                       }
+               if ($resolveParameterPlaceholders === TRUE) {
+                       $statementParts = $this->resolveParameterPlaceholders($statementParts, $parameters);
+               }
 
-                       return array($statementParts, $parameters);
+               return array($statementParts, $parameters);
        }
 
        /**
         * Replaces the parameters in the queryStructure with given values
         *
-        * @param string $whereStatement
+        * @param array $statementParts
         * @param array $parameters
-        * @return string
+        * @return array
         */
-       protected function resolveParameterPlaceholders($statementParts, $parameters = array()) {
+       protected function resolveParameterPlaceholders(array $statementParts, array $parameters) {
                $tableNameForEscape = (reset($statementParts['tables']) ?: 'foo');
 
                foreach ($parameters as $parameterPlaceholder => $parameter) {
@@ -534,8 +534,8 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
                                $parameter = implode(',', $subParameters);
                        } elseif ($parameter === NULL) {
                                $parameter = 'NULL';
-                       } elseif (is_bool($input)) {
-                               return ($input === TRUE ? 1 : 0);
+                       } elseif (is_bool($parameter)) {
+                               $parameter = (int)$parameter;
                        } else {
                                $parameter = $this->databaseHandle->fullQuoteStr((string)$parameter, $tableNameForEscape);
                        }
@@ -618,7 +618,7 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
                                throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnexpectedTypeException('An object of class "' . get_class($realInput) . '" could not be converted to a plain value.', 1274799934);
                        }
                } elseif (is_bool($input)) {
-                       return $input === TRUE ? 1 : 0;
+                       return (int)$input;
                } else {
                        return $input;
                }
@@ -748,68 +748,68 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
         * @param null|integer $workspaceUid
         * @return array
         */
-       protected function doLanguageAndWorkspaceOverlay(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source, array $rows, $querySettings, $workspaceUid = NULL) {
+       protected function doLanguageAndWorkspaceOverlay(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source, array $rows, \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings, $workspaceUid = NULL) {
                if ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
                        $tableName = $source->getSelectorName();
                } elseif ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface) {
                        $tableName = $source->getRight()->getSelectorName();
+               } else {
+                       // No proper source, so we do not have a table name here
+                       // we cannot do an overlay and return the original rows instead.
+                       return $rows;
                }
-               // If we do not have a table name here, we cannot do an overlay and return the original rows instead.
-               if (isset($tableName)) {
-                       $pageRepository = $this->getPageRepository();
-                       if (is_object($GLOBALS['TSFE'])) {
-                               if ($workspaceUid !== NULL) {
-                                       $pageRepository->versioningWorkspaceId = $workspaceUid;
-                               }
-                       } else {
-                               if ($workspaceUid === NULL) {
-                                       $workspaceUid = $GLOBALS['BE_USER']->workspace;
-                               }
+
+               $pageRepository = $this->getPageRepository();
+               if (is_object($GLOBALS['TSFE'])) {
+                       if ($workspaceUid !== NULL) {
                                $pageRepository->versioningWorkspaceId = $workspaceUid;
                        }
-
-                       $overlayedRows = array();
-                       foreach ($rows as $row) {
-                               // If current row is a translation select its parent
-                               if (isset($tableName) && isset($GLOBALS['TCA'][$tableName])
-                                       && isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
-                                       && isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
-                                       && !isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'])
-                               ) {
-                                       if (isset($row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']])
-                                               && $row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] > 0
-                                       ) {
-                                               $row = $this->databaseHandle->exec_SELECTgetSingleRow(
-                                                       $tableName . '.*',
-                                                       $tableName,
-                                                       $tableName . '.uid=' . (int)$row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] .
-                                                               ' AND ' . $tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] . '=0'
-                                               );
-                                       }
-                               }
-                               $pageRepository->versionOL($tableName, $row, TRUE);
-                               if ($pageRepository->versioningPreview && isset($row['_ORIG_uid'])) {
-                                       $row['uid'] = $row['_ORIG_uid'];
-                               }
-                               if ($tableName == 'pages') {
-                                       $row = $pageRepository->getPageOverlay($row, $querySettings->getLanguageUid());
-                               } elseif (isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
-                                       && $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] !== ''
-                                       && !isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'])
+               } else {
+                       if ($workspaceUid === NULL) {
+                               $workspaceUid = $GLOBALS['BE_USER']->workspace;
+                       }
+                       $pageRepository->versioningWorkspaceId = $workspaceUid;
+               }
+
+               $overlaidRows = array();
+               foreach ($rows as $row) {
+                       // If current row is a translation select its parent
+                       if (isset($tableName) && isset($GLOBALS['TCA'][$tableName])
+                               && isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
+                               && isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
+                               && !isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'])
+                       ) {
+                               if (isset($row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']])
+                                       && $row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] > 0
                                ) {
-                                       if (in_array($row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField']], array(-1, 0))) {
-                                               $overlayMode = $querySettings->getLanguageMode() === 'strict' ? 'hideNonTranslated' : '';
-                                               $row = $pageRepository->getRecordOverlay($tableName, $row, $querySettings->getLanguageUid(), $overlayMode);
-                                       }
+                                       $row = $this->databaseHandle->exec_SELECTgetSingleRow(
+                                               $tableName . '.*',
+                                               $tableName,
+                                               $tableName . '.uid=' . (int)$row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] .
+                                                       ' AND ' . $tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] . '=0'
+                                       );
                                }
-                               if ($row !== NULL && is_array($row)) {
-                                       $overlayedRows[] = $row;
+                       }
+                       $pageRepository->versionOL($tableName, $row, TRUE);
+                       if ($pageRepository->versioningPreview && isset($row['_ORIG_uid'])) {
+                               $row['uid'] = $row['_ORIG_uid'];
+                       }
+                       if ($tableName == 'pages') {
+                               $row = $pageRepository->getPageOverlay($row, $querySettings->getLanguageUid());
+                       } elseif (isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
+                               && $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] !== ''
+                               && !isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'])
+                       ) {
+                               if (in_array($row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField']], array(-1, 0))) {
+                                       $overlayMode = $querySettings->getLanguageMode() === 'strict' ? 'hideNonTranslated' : '';
+                                       $row = $pageRepository->getRecordOverlay($tableName, $row, $querySettings->getLanguageUid(), $overlayMode);
                                }
                        }
-               } else {
-                       $overlayedRows = $rows;
+                       if ($row !== NULL && is_array($row)) {
+                               $overlaidRows[] = $row;
+                       }
                }
-               return $overlayedRows;
+               return $overlaidRows;
        }
 
        /**
index d8960a4..22af78c 100644 (file)
@@ -29,7 +29,11 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Storage;
  ***************************************************************/
 
 use TYPO3\CMS\Backend\Utility\BackendUtility;
+use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap;
+use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
+use TYPO3\CMS\Extbase\Persistence\QueryInterface;
 use TYPO3\CMS\Extbase\Utility\TypeHandlingUtility;
+use TYPO3\CMS\Extbase\Persistence\Generic\Qom;
 
 /**
  * QueryParser, converting the qom to string representation
@@ -92,10 +96,10 @@ class Typo3DbQueryParser {
        /**
         * Preparses the query and returns the query's hash and the parameters
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query The query
+        * @param QueryInterface $query The query
         * @return array the hash and the parameters
         */
-       public function preparseQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query) {
+       public function preparseQuery(QueryInterface $query) {
                list($parameters, $operators) = $this->preparseComparison($query->getConstraint());
                $hashPartials = array(
                        $query->getQuerySettings(),
@@ -117,7 +121,7 @@ class Typo3DbQueryParser {
         * statement. It leaves out the actual statement generation, as it is the most time
         * consuming.
         *
-        * @param object $comparison The constraint. Could be And-, Or-, Not- or ComparisonInterface
+        * @param Qom\ConstraintInterface $comparison The constraint. Could be And-, Or-, Not- or ComparisonInterface
         * @param string $qomPath current position of the child in the qom
         * @return array Array of parameters and operators
         * @throws \Exception
@@ -127,21 +131,23 @@ class Typo3DbQueryParser {
                $operators = array();
                $objectsToParse = array();
 
-               if ($comparison instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface) {
+               $delimiter = '';
+               if ($comparison instanceof Qom\AndInterface) {
                        $delimiter = 'AND';
                        $objectsToParse = array($comparison->getConstraint1(), $comparison->getConstraint2());
-               } elseif ($comparison instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface) {
+               } elseif ($comparison instanceof Qom\OrInterface) {
                        $delimiter = 'OR';
                        $objectsToParse = array($comparison->getConstraint1(), $comparison->getConstraint2());
-               } elseif ($comparison instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface) {
+               } elseif ($comparison instanceof Qom\NotInterface) {
                        $delimiter = 'NOT';
                        $objectsToParse = array($comparison->getConstraint());
-               } elseif ($comparison instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface) {
-                       $parameterIdentifier = $this->normalizeParameterIdentifier($qomPath . $comparison->getOperand1()->getPropertyName());
+               } elseif ($comparison instanceof Qom\ComparisonInterface) {
+                       $operand1 = $comparison->getOperand1();
+                       $parameterIdentifier = $this->normalizeParameterIdentifier($qomPath . $operand1->getPropertyName());
                        $comparison->setParameterIdentifier($parameterIdentifier);
                        $operator = $comparison->getOperator();
                        $operand2 = $comparison->getOperand2();
-                       if ($operator === \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_IN) {
+                       if ($operator === QueryInterface::OPERATOR_IN) {
                                $items = array();
                                foreach ($operand2 as $value) {
                                        $value = $this->getPlainValue($value);
@@ -189,10 +195,10 @@ class Typo3DbQueryParser {
        /**
         * Parses the query and returns the SQL statement parts.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query The query
+        * @param QueryInterface $query The query
         * @return array The SQL statement parts
         */
-       public function parseQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query) {
+       public function parseQuery(QueryInterface $query) {
                $sql = array();
                $sql['keywords'] = array();
                $sql['tables'] = array();
@@ -221,18 +227,18 @@ class Typo3DbQueryParser {
        /**
         * Transforms a Query Source into SQL and parameter arrays
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source The source
+        * @param Qom\SourceInterface $source The source
         * @param array &$sql
         * @return void
         */
-       protected function parseSource(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source, array &$sql) {
-               if ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
+       protected function parseSource(Qom\SourceInterface $source, array &$sql) {
+               if ($source instanceof Qom\SelectorInterface) {
                        $className = $source->getNodeTypeName();
                        $tableName = $this->dataMapper->getDataMap($className)->getTableName();
                        $this->addRecordTypeConstraint($className, $sql);
                        $sql['fields'][$tableName] = $tableName . '.*';
                        $sql['tables'][$tableName] = $tableName;
-               } elseif ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface) {
+               } elseif ($source instanceof Qom\JoinInterface) {
                        $this->parseJoin($source, $sql);
                }
        }
@@ -240,29 +246,29 @@ class Typo3DbQueryParser {
        /**
         * Transforms a constraint into SQL and parameter arrays
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint The constraint
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source The source
+        * @param Qom\ConstraintInterface $constraint The constraint
+        * @param Qom\SourceInterface $source The source
         * @param array &$sql The query parts
         * @return void
         */
-       protected function parseConstraint(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint = NULL, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source, array &$sql) {
-               if ($constraint instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface) {
+       protected function parseConstraint(Qom\ConstraintInterface $constraint = NULL, Qom\SourceInterface $source, array &$sql) {
+               if ($constraint instanceof Qom\AndInterface) {
                        $sql['where'][] = '(';
                        $this->parseConstraint($constraint->getConstraint1(), $source, $sql);
                        $sql['where'][] = ' AND ';
                        $this->parseConstraint($constraint->getConstraint2(), $source, $sql);
                        $sql['where'][] = ')';
-               } elseif ($constraint instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface) {
+               } elseif ($constraint instanceof Qom\OrInterface) {
                        $sql['where'][] = '(';
                        $this->parseConstraint($constraint->getConstraint1(), $source, $sql);
                        $sql['where'][] = ' OR ';
                        $this->parseConstraint($constraint->getConstraint2(), $source, $sql);
                        $sql['where'][] = ')';
-               } elseif ($constraint instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface) {
+               } elseif ($constraint instanceof Qom\NotInterface) {
                        $sql['where'][] = 'NOT (';
                        $this->parseConstraint($constraint->getConstraint(), $source, $sql);
                        $sql['where'][] = ')';
-               } elseif ($constraint instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface) {
+               } elseif ($constraint instanceof Qom\ComparisonInterface) {
                        $this->parseComparison($constraint, $source, $sql);
                }
        }
@@ -270,24 +276,23 @@ class Typo3DbQueryParser {
        /**
         * Transforms orderings into SQL.
         *
-        * @param array $orderings An array of orderings (Tx_Extbase_Persistence_QOM_Ordering)
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source The source
+        * @param array $orderings An array of orderings (Qom\Ordering)
+        * @param Qom\SourceInterface $source The source
         * @param array &$sql The query parts
-        * @throws \RuntimeException
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnsupportedOrderException
         * @return void
         */
-       protected function parseOrderings(array $orderings, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source, array &$sql) {
+       protected function parseOrderings(array $orderings, Qom\SourceInterface $source, array &$sql) {
                foreach ($orderings as $propertyName => $order) {
                        switch ($order) {
-                               case \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_ASCENDING:
+                               case Qom\QueryObjectModelConstantsInterface::JCR_ORDER_ASCENDING:
 
-                               case \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING:
+                               case QueryInterface::ORDER_ASCENDING:
                                        $order = 'ASC';
                                        break;
-                               case \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelConstantsInterface::JCR_ORDER_DESCENDING:
+                               case Qom\QueryObjectModelConstantsInterface::JCR_ORDER_DESCENDING:
 
-                               case \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING:
+                               case QueryInterface::ORDER_DESCENDING:
                                        $order = 'DESC';
                                        break;
                                default:
@@ -295,13 +300,13 @@ class Typo3DbQueryParser {
                        }
                        $className = '';
                        $tableName = '';
-                       if ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
+                       if ($source instanceof Qom\SelectorInterface) {
                                $className = $source->getNodeTypeName();
                                $tableName = $this->dataMapper->convertClassNameToTableName($className);
                                while (strpos($propertyName, '.') !== FALSE) {
                                        $this->addUnionStatement($className, $tableName, $propertyName, $sql);
                                }
-                       } elseif ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface) {
+                       } elseif ($source instanceof Qom\JoinInterface) {
                                $tableName = $source->getLeft()->getSelectorName();
                        }
                        $columnName = $this->dataMapper->convertPropertyNameToColumnName($propertyName, $className);
@@ -316,19 +321,19 @@ class Typo3DbQueryParser {
        /**
         * Parse a Comparison into SQL and parameter arrays.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface $comparison The comparison to parse
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source The source
+        * @param Qom\ComparisonInterface $comparison The comparison to parse
+        * @param Qom\SourceInterface $source The source
         * @param array &$sql SQL query parts to add to
+        * @throws \RuntimeException
         * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\RepositoryException
         * @return void
         */
-       protected function parseComparison(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface $comparison, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source, array &$sql) {
+       protected function parseComparison(Qom\ComparisonInterface $comparison, Qom\SourceInterface $source, array &$sql) {
                $parameterIdentifier = $this->normalizeParameterIdentifier($comparison->getParameterIdentifier());
-               $operand1 = $comparison->getOperand1();
+
                $operator = $comparison->getOperator();
                $operand2 = $comparison->getOperand2();
-               if ($operator === \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_IN) {
-                       $items = array();
+               if ($operator === QueryInterface::OPERATOR_IN) {
                        $hasValue = FALSE;
                        foreach ($operand2 as $value) {
                                $value = $this->getPlainValue($value);
@@ -340,14 +345,18 @@ class Typo3DbQueryParser {
                        if ($hasValue === FALSE) {
                                $sql['where'][] = '1<>1';
                        } else {
-                               $this->parseDynamicOperand($comparison, $operator, $source, $sql, NULL);
+                               $this->parseDynamicOperand($comparison, $operator, $source, $sql);
                        }
-               } elseif ($operator === \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_CONTAINS) {
+               } elseif ($operator === QueryInterface::OPERATOR_CONTAINS) {
                        if ($operand2 === NULL) {
                                $sql['where'][] = '1<>1';
                        } else {
+                               if (!$source instanceof Qom\SelectorInterface) {
+                                       throw new \RuntimeException('Source is not of type "SelectorInterface"', 1395362539);
+                               }
                                $className = $source->getNodeTypeName();
                                $tableName = $this->dataMapper->convertClassNameToTableName($className);
+                               $operand1 = $comparison->getOperand1();
                                $propertyName = $operand1->getPropertyName();
                                while (strpos($propertyName, '.') !== FALSE) {
                                        $this->addUnionStatement($className, $tableName, $propertyName, $sql);
@@ -355,11 +364,11 @@ class Typo3DbQueryParser {
                                $columnName = $this->dataMapper->convertPropertyNameToColumnName($propertyName, $className);
                                $dataMap = $this->dataMapper->getDataMap($className);
                                $columnMap = $dataMap->getColumnMap($propertyName);
-                               $typeOfRelation = $columnMap instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap ? $columnMap->getTypeOfRelation() : NULL;
-                               if ($typeOfRelation === \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
+                               $typeOfRelation = $columnMap instanceof ColumnMap ? $columnMap->getTypeOfRelation() : NULL;
+                               if ($typeOfRelation === ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
                                        $relationTableName = $columnMap->getRelationTableName();
                                        $sql['where'][] = $tableName . '.uid IN (SELECT ' . $columnMap->getParentKeyFieldName() . ' FROM ' . $relationTableName . ' WHERE ' . $columnMap->getChildKeyFieldName() . '=' . $parameterIdentifier . ')';
-                               } elseif ($typeOfRelation === \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::RELATION_HAS_MANY) {
+                               } elseif ($typeOfRelation === ColumnMap::RELATION_HAS_MANY) {
                                        $parentKeyFieldName = $columnMap->getParentKeyFieldName();
                                        if (isset($parentKeyFieldName)) {
                                                $childTableName = $columnMap->getChildTableName();
@@ -379,29 +388,30 @@ class Typo3DbQueryParser {
        /**
         * Parse a DynamicOperand into SQL and parameter arrays.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface $comparison
+        * @param Qom\ComparisonInterface $comparison
         * @param string $operator One of the JCR_OPERATOR_* constants
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source The source
+        * @param Qom\SourceInterface $source The source
         * @param array &$sql The query parts
         * @param string $valueFunction an optional SQL function to apply to the operand value
         * @return void
         */
-       protected function parseDynamicOperand(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface $comparison, $operator, \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source, array &$sql, $valueFunction = NULL) {
+       protected function parseDynamicOperand(Qom\ComparisonInterface $comparison, $operator, Qom\SourceInterface $source, array &$sql, $valueFunction = NULL) {
                $operand = $comparison->getOperand1();
-               if ($operand instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\LowerCaseInterface) {
+               if ($operand instanceof Qom\LowerCaseInterface) {
                        $this->parseDynamicOperand($operand->getOperand(), $operator, $source, $sql, 'LOWER');
-               } elseif ($operand instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\UpperCaseInterface) {
+               } elseif ($operand instanceof Qom\UpperCaseInterface) {
                        $this->parseDynamicOperand($operand->getOperand(), $operator, $source, $sql, 'UPPER');
-               } elseif ($operand instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\PropertyValueInterface) {
+               } elseif ($operand instanceof Qom\PropertyValueInterface) {
                        $propertyName = $operand->getPropertyName();
-                       if ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SelectorInterface) {
+                       $className = '';
+                       if ($source instanceof Qom\SelectorInterface) {
                                // FIXME Only necessary to differ from  Join
                                $className = $source->getNodeTypeName();
                                $tableName = $this->dataMapper->convertClassNameToTableName($className);
                                while (strpos($propertyName, '.') !== FALSE) {
                                        $this->addUnionStatement($className, $tableName, $propertyName, $sql);
                                }
-                       } elseif ($source instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface) {
+                       } elseif ($source instanceof Qom\JoinInterface) {
                                $tableName = $source->getJoinCondition()->getSelector1Name();
                        }
                        $columnName = $this->dataMapper->convertPropertyNameToColumnName($propertyName, $className);
@@ -459,12 +469,12 @@ class Typo3DbQueryParser {
        /**
         * Adds additional WHERE statements according to the query settings.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings The TYPO3 CMS specific query settings
+        * @param QuerySettingsInterface $querySettings The TYPO3 CMS specific query settings
         * @param string $tableName The table name to add the additional where clause for
         * @param string &$sql
         * @return void
         */
-       protected function addAdditionalWhereClause(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings, $tableName, &$sql) {
+       protected function addAdditionalWhereClause(QuerySettingsInterface $querySettings, $tableName, &$sql) {
                $this->addVisibilityConstraintStatement($querySettings, $tableName, $sql);
                if ($querySettings->getRespectSysLanguage()) {
                        $this->addSysLanguageStatement($tableName, $sql, $querySettings);
@@ -477,12 +487,12 @@ class Typo3DbQueryParser {
        /**
         * Adds enableFields and deletedClause to the query if necessary
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings
+        * @param QuerySettingsInterface $querySettings
         * @param string $tableName The database table name
         * @param array &$sql The query parts
         * @return void
         */
-       protected function addVisibilityConstraintStatement(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings, $tableName, array &$sql) {
+       protected function addVisibilityConstraintStatement(QuerySettingsInterface $querySettings, $tableName, array &$sql) {
                $statement = '';
                if (is_array($GLOBALS['TCA'][$tableName]['ctrl'])) {
                        $ignoreEnableFields = $querySettings->getIgnoreEnableFields();
@@ -552,7 +562,7 @@ class Typo3DbQueryParser {
         *
         * @param string $tableName The database table name
         * @param array &$sql The query parts
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings The TYPO3 CMS specific query settings
+        * @param QuerySettingsInterface $querySettings The TYPO3 CMS specific query settings
         * @return void
         */
        protected function addSysLanguageStatement($tableName, array &$sql, $querySettings) {
@@ -588,6 +598,7 @@ class Typo3DbQueryParser {
         * @param string $tableName The database table name
         * @param array &$sql The query parts
         * @param array $storagePageIds list of storage page ids
+        * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\InconsistentQuerySettingsException
         * @return void
         */
        protected function addPageIdStatement($tableName, array &$sql, array $storagePageIds) {
@@ -614,19 +625,20 @@ class Typo3DbQueryParser {
        /**
         * Transforms a Join into SQL and parameter arrays
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface $join The join
+        * @param Qom\JoinInterface $join The join
         * @param array &$sql The query parts
         * @return void
         */
-       protected function parseJoin(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface $join, array &$sql) {
+       protected function parseJoin(Qom\JoinInterface $join, array &$sql) {
                $leftSource = $join->getLeft();
                $leftClassName = $leftSource->getNodeTypeName();
-               $this->addRecordTypeConstraint($leftClassName, $sql);
                $leftTableName = $leftSource->getSelectorName();
+               $this->addRecordTypeConstraint($leftClassName, $sql);
                $rightSource = $join->getRight();
-               if ($rightSource instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface) {
-                       $rightClassName = $rightSource->getLeft()->getNodeTypeName();
-                       $rightTableName = $rightSource->getLeft()->getSelectorName();
+               if ($rightSource instanceof Qom\JoinInterface) {
+                       $left = $rightSource->getLeft();
+                       $rightClassName = $left->getNodeTypeName();
+                       $rightTableName = $left->getSelectorName();
                } else {
                        $rightClassName = $rightSource->getNodeTypeName();
                        $rightTableName = $rightSource->getSelectorName();
@@ -636,12 +648,12 @@ class Typo3DbQueryParser {
                $sql['tables'][$leftTableName] = $leftTableName;
                $sql['unions'][$rightTableName] = 'LEFT JOIN ' . $rightTableName;
                $joinCondition = $join->getJoinCondition();
-               if ($joinCondition instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\EquiJoinCondition) {
+               if ($joinCondition instanceof Qom\EquiJoinCondition) {
                        $column1Name = $this->dataMapper->convertPropertyNameToColumnName($joinCondition->getProperty1Name(), $leftClassName);
                        $column2Name = $this->dataMapper->convertPropertyNameToColumnName($joinCondition->getProperty2Name(), $rightClassName);
                        $sql['unions'][$rightTableName] .= ' ON ' . $joinCondition->getSelector1Name() . '.' . $column1Name . ' = ' . $joinCondition->getSelector2Name() . '.' . $column2Name;
                }
-               if ($rightSource instanceof \TYPO3\CMS\Extbase\Persistence\Generic\Qom\JoinInterface) {
+               if ($rightSource instanceof Qom\JoinInterface) {
                        $this->parseJoin($rightSource, $sql);
                }
        }
@@ -709,14 +721,14 @@ class Typo3DbQueryParser {
                        throw new \TYPO3\CMS\Extbase\Persistence\Generic\Exception\InvalidRelationConfigurationException('The relation information for property "' . $propertyName . '" of class "' . $className . '" is missing.', 1353170925);
                }
 
-               if ($columnMap->getTypeOfRelation() === \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::RELATION_HAS_ONE) {
+               if ($columnMap->getTypeOfRelation() === ColumnMap::RELATION_HAS_ONE) {
                        if (isset($parentKeyFieldName)) {
                                $sql['unions'][$childTableName] = 'LEFT JOIN ' . $childTableName . ' ON ' . $tableName . '.uid=' . $childTableName . '.' . $parentKeyFieldName;
                        } else {
                                $sql['unions'][$childTableName] = 'LEFT JOIN ' . $childTableName . ' ON ' . $tableName . '.' . $columnName . '=' . $childTableName . '.uid';
                        }
                        $className = $this->dataMapper->getType($className, $propertyName);
-               } elseif ($columnMap->getTypeOfRelation() === \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::RELATION_HAS_MANY) {
+               } elseif ($columnMap->getTypeOfRelation() === ColumnMap::RELATION_HAS_MANY) {
                        if (isset($parentKeyFieldName)) {
                                $sql['unions'][$childTableName] = 'LEFT JOIN ' . $childTableName . ' ON ' . $tableName . '.uid=' . $childTableName . '.' . $parentKeyFieldName;
                        } else {
@@ -724,7 +736,7 @@ class Typo3DbQueryParser {
                                $sql['unions'][$childTableName] = 'LEFT JOIN ' . $childTableName . ' ON ' . $onStatement;
                        }
                        $className = $this->dataMapper->getType($className, $propertyName);
-               } elseif ($columnMap->getTypeOfRelation() === \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
+               } elseif ($columnMap->getTypeOfRelation() === ColumnMap::RELATION_HAS_AND_BELONGS_TO_MANY) {
                        $relationTableName = $columnMap->getRelationTableName();
                        $sql['unions'][$relationTableName] = 'LEFT JOIN ' . $relationTableName . ' ON ' . $tableName . '.uid=' . $relationTableName . '.' . $columnMap->getParentKeyFieldName();
                        $sql['unions'][$childTableName] = 'LEFT JOIN ' . $childTableName . ' ON ' . $relationTableName . '.' . $columnMap->getChildKeyFieldName() . '=' . $childTableName . '.uid';
@@ -747,34 +759,34 @@ class Typo3DbQueryParser {
         */
        protected function resolveOperator($operator) {
                switch ($operator) {
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_IN:
+                       case QueryInterface::OPERATOR_IN:
                                $operator = 'IN';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_EQUAL_TO:
+                       case QueryInterface::OPERATOR_EQUAL_TO:
                                $operator = '=';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_EQUAL_TO_NULL:
+                       case QueryInterface::OPERATOR_EQUAL_TO_NULL:
                                $operator = 'IS';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_NOT_EQUAL_TO:
+                       case QueryInterface::OPERATOR_NOT_EQUAL_TO:
                                $operator = '!=';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_NOT_EQUAL_TO_NULL:
+                       case QueryInterface::OPERATOR_NOT_EQUAL_TO_NULL:
                                $operator = 'IS NOT';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LESS_THAN:
+                       case QueryInterface::OPERATOR_LESS_THAN:
                                $operator = '<';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LESS_THAN_OR_EQUAL_TO:
+                       case QueryInterface::OPERATOR_LESS_THAN_OR_EQUAL_TO:
                                $operator = '<=';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_GREATER_THAN:
+                       case QueryInterface::OPERATOR_GREATER_THAN:
                                $operator = '>';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO:
+                       case QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO:
                                $operator = '>=';
                                break;
-                       case \TYPO3\CMS\Extbase\Persistence\QueryInterface::OPERATOR_LIKE:
+                       case QueryInterface::OPERATOR_LIKE:
                                $operator = 'LIKE';
                                break;
                        default:
index 6e82b74..c65706c 100644 (file)
@@ -35,7 +35,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  *
  * @api
  */
-class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface {
+class Typo3QuerySettings implements QuerySettingsInterface {
 
        /**
         * Flag if the storage page should be respected for the query.
@@ -158,7 +158,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
         * Sets the flag if the storage page should be respected for the query.
         *
         * @param bool $respectStoragePage If TRUE the storage page ID will be determined and the statement will be extended accordingly.
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         * @api
         */
        public function setRespectStoragePage($respectStoragePage) {
@@ -179,7 +179,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
         * Sets the pid(s) of the storage page(s) that should be respected for the query.
         *
         * @param array $storagePageIds If given the storage page IDs will be determined and the statement will be extended accordingly.
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         * @api
         */
        public function setStoragePageIds(array $storagePageIds) {
@@ -198,7 +198,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
 
        /**
         * @param bool $respectSysLanguage TRUE if TYPO3 language settings are to be applied
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface (fluent interface)
+        * @return QuerySettingsInterface
         * @api
         */
        public function setRespectSysLanguage($respectSysLanguage) {
@@ -215,7 +215,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
 
        /**
         * @param mixed $languageOverlayMode TRUE, FALSE or "hideNonTranslated"
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface instance of $this to allow method chaining
+        * @return QuerySettingsInterface instance of $this to allow method chaining
         * @api
         */
        public function setLanguageOverlayMode($languageOverlayMode = FALSE) {
@@ -232,7 +232,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
 
        /**
         * @param string $languageMode NULL, "content_fallback", "strict" or "ignore"
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface instance of $this to allow method chaining
+        * @return QuerySettingsInterface instance of $this to allow method chaining
         * @api
         */
        public function setLanguageMode($languageMode = '') {
@@ -249,7 +249,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
 
        /**
         * @param int $languageUid
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface instance of $this to allow method chaining
+        * @return QuerySettingsInterface instance of $this to allow method chaining
         * @api
         */
        public function setLanguageUid($languageUid) {
@@ -268,7 +268,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
         * Sets the language uid for the language overlay.
         *
         * @param int $sysLanguageUid language uid for the language overlay
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface instance of $this to allow method chaining
+        * @return QuerySettingsInterface instance of $this to allow method chaining
         * @deprecated since Extbase 6.2, will be removed two versions later. Use setLanguageUid() instead.
         */
        public function setSysLanguageUid($sysLanguageUid) {
@@ -291,7 +291,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
         * Sets the flag if the visibility in the frontend should be respected.
         *
         * @param bool $respectEnableFields TRUE if the visibility in the frontend should be respected. If TRUE, the "enable fields" of TYPO3 will be added to the query statement.
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         * @deprecated since Extbase 6.0, will be removed two versions later. Use setIgnoreEnableFields() and setEnableFieldsToBeIgnored() instead.
         * @see setIgnoreEnableFields()
         * @see setEnableFieldsToBeIgnored()
@@ -323,7 +323,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
         * enable fields are taken into account, regardless of the enableFieldsToBeIgnored setting.
         *
         * @param bool $ignoreEnableFields
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         * @see setEnableFieldsToBeIgnored()
         * @api
         */
@@ -351,7 +351,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
         * by this column. This setting is only taken into account if $this->ignoreEnableFields = TRUE.
         *
         * @param array $enableFieldsToBeIgnored
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         * @see setIgnoreEnableFields()
         * @api
         */
@@ -375,7 +375,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
         * Sets the flag if the query should return objects that are deleted.
         *
         * @param bool $includeDeleted
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         * @api
         */
        public function setIncludeDeleted($includeDeleted) {
@@ -396,7 +396,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
         * Sets the state, if the QueryResult should be returned unmapped.
         *
         * @param bool $returnRawQueryResult TRUE, if the QueryResult should be returned unmapped; otherwise FALSE.
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         * @deprecated since Extbase 6.2, will be removed two versions later. Please use argument in query->execute() instead.
         */
        public function setReturnRawQueryResult($returnRawQueryResult) {
@@ -418,7 +418,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
 
        /**
         * @param bool $usePreparedStatement
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         */
        public function usePreparedStatement($usePreparedStatement) {
                $this->usePreparedStatement = $usePreparedStatement;
@@ -434,7 +434,7 @@ class Typo3QuerySettings implements \TYPO3\CMS\Extbase\Persistence\Generic\Query
 
        /**
         * @param bool $useQueryCache
-        * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
+        * @return QuerySettingsInterface
         */
        public function useQueryCache($useQueryCache) {
                $this->useQueryCache = $useQueryCache;
index 84fa1d6..f8d68bb 100644 (file)
@@ -33,7 +33,7 @@ namespace TYPO3\CMS\Extbase\Persistence;
  *
  * Opposed to the SplObjectStorage the ObjectStorage does not implement the Serializable interface.
  */
-class ObjectStorage implements \Countable, \Iterator, \ArrayAccess, \TYPO3\CMS\Extbase\Persistence\ObjectMonitoringInterface {
+class ObjectStorage implements \Countable, \Iterator, \ArrayAccess, ObjectMonitoringInterface {
 
        /**
         * This field is only needed to make debugging easier:
@@ -258,10 +258,10 @@ class ObjectStorage implements \Countable, \Iterator, \ArrayAccess, \TYPO3\CMS\E
        /**
         * Adds all objects-data pairs from a different storage in the current storage.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $objectStorage
+        * @param ObjectStorage $objectStorage
         * @return void
         */
-       public function addAll(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $objectStorage) {
+       public function addAll(ObjectStorage $objectStorage) {
                foreach ($objectStorage as $object) {
                        $this->attach($object, $objectStorage->getInfo());
                }
@@ -270,10 +270,10 @@ class ObjectStorage implements \Countable, \Iterator, \ArrayAccess, \TYPO3\CMS\E
        /**
         * Removes objects contained in another storage from the current storage.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $objectStorage The storage containing the elements to remove.
+        * @param ObjectStorage $objectStorage The storage containing the elements to remove.
         * @return void
         */
-       public function removeAll(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $objectStorage) {
+       public function removeAll(ObjectStorage $objectStorage) {
                foreach ($objectStorage as $object) {
                        $this->detach($object);
                }
index d8c4db9..92a6ef4 100644 (file)
@@ -91,22 +91,22 @@ interface PersistenceManagerInterface {
        /**
         * Returns the number of records matching the query.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @param QueryInterface $query
         * @return integer
         * @deprecated since Extbase 6.0, will be removed in Extbase 7.0
         * @api
         */
-       public function getObjectCountByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
+       public function getObjectCountByQuery(QueryInterface $query);
 
        /**
         * Returns the object data matching the $query.
         *
-        * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
+        * @param QueryInterface $query
         * @return array
         * @deprecated since Extbase 6.0, will be removed in Extbase 7.0
         * @api
         */
-       public function getObjectDataByQuery(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query);
+       public function getObjectDataByQuery(QueryInterface $query);
 
        /**
         * Registers a repository
@@ -180,7 +180,7 @@ interface PersistenceManagerInterface {
         * Return a query object for the given type.
         *
         * @param string $type
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
+        * @return QueryInterface
         * @api
         */
        public function createQueryForType($type);
index e63b57a..b4a41ff 100644 (file)
@@ -216,11 +216,11 @@ interface QueryInterface {
        /**
         * Performs a logical negation of the given constraint
         *
-        * @param object $constraint Constraint to negate
-        * @return object
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint Constraint to negate
+        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface
         * @api
         */
-       public function logicalNot($constraint);
+       public function logicalNot(\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface $constraint);
 
        /**
         * Returns an equals criterion used for matching objects against a query.
@@ -232,7 +232,7 @@ interface QueryInterface {
         * @param string $propertyName The name of the property to compare against
         * @param mixed $operand The value to compare with
         * @param boolean $caseSensitive Whether the equality test should be done case-sensitive for strings
-        * @return object
+        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface
         * @api
         */
        public function equals($propertyName, $operand, $caseSensitive = TRUE);
@@ -339,13 +339,13 @@ interface QueryInterface {
         * @todo decide whether this can be deprecated somewhen
         * @api This method is not part of TYPO3Flow API
         */
-       public function setQuerySettings(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings);
+       public function setQuerySettings(Generic\QuerySettingsInterface $querySettings);
 
        /**
         * Returns the Query Settings.
         *
         * @return \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface $querySettings The Query Settings
-        * @todo decide whether this can be deprecated somewhen
+        * @todo decide whether this can be deprecated eventually
         * @api This method is not part of  TYPO3Flow API
         */
        public function getQuerySettings();
@@ -389,7 +389,7 @@ interface QueryInterface {
        /**
         * Gets the constraint for this query.
         *
-        * @return mixed the constraint, or null if none
+        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface|NULL the constraint, or null if none
         * @api
         */
        public function getConstraint();
@@ -404,4 +404,19 @@ interface QueryInterface {
         * @api
         */
        public function isEmpty($propertyName);
+
+       /**
+        * Sets the source to fetch the result from
+        *
+        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface $source
+        */
+       public function setSource(Generic\Qom\SourceInterface $source);
+
+       /**
+        * Returns the statement of this query.
+        *
+        * @return \TYPO3\CMS\Extbase\Persistence\Generic\Qom\Statement
+        */
+       public function getStatement();
+
 }
index 03ca6ea..754ab30 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Extbase\Persistence;
  *
  * @api
  */
-class Repository implements \TYPO3\CMS\Extbase\Persistence\RepositoryInterface, \TYPO3\CMS\Core\SingletonInterface {
+class Repository implements RepositoryInterface, \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\IdentityMap
@@ -153,7 +153,7 @@ class Repository implements \TYPO3\CMS\Extbase\Persistence\RepositoryInterface,
        /**
         * Returns all objects of this repository.
         *
-        * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface|array
+        * @return QueryResultInterface|array
         * @api
         */
        public function findAll() {
@@ -292,7 +292,7 @@ class Repository implements \TYPO3\CMS\Extbase\Persistence\RepositoryInterface,
                        $query = $this->createQuery();
 
                        $result = $query->matching($query->equals($propertyName, $arguments[0]))->setLimit(1)->execute();
-                       if ($result instanceof \TYPO3\CMS\Extbase\Persistence\QueryResultInterface) {
+                       if ($result instanceof QueryResultInterface) {
                                return $result->getFirst();
                        } elseif (is_array($result)) {
                                return isset($result[0]) ? $result[0] : NULL;
index 309870a..1bb0f69 100644 (file)
@@ -164,7 +164,7 @@ class QueryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                /** @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject $objectManager */
                $objectManager = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
                /** @var \TYPO3\CMS\Extbase\Persistence\Generic\Qom\DynamicOperandInterface $dynamicOperand */
-               $dynamicOperand = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\DynamicOperand');
+               $dynamicOperand = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\DynamicOperandInterface');
                $objectManager->expects($this->any())->method('get')->will($this->returnValue($dynamicOperand));
                /** @var $qomFactory \TYPO3\CMS\Extbase\Persistence\Generic\Qom\QueryObjectModelFactory */
                $qomFactory = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\QueryObjectModelFactory', array('comparison'));