[!!!] [~TASK] BlogExample (Domain): The directory structure of the Domain has changed...
authorJochen Rau <j.rau@web.de>
Thu, 23 Jul 2009 23:23:17 +0000 (23:23 +0000)
committerJochen Rau <j.rau@web.de>
Thu, 23 Jul 2009 23:23:17 +0000 (23:23 +0000)
[!!!] [~TASK] Extbase (Domain): The directory structure of the Domain has changed accordting to changes in FLOW3 (see above). Please Change your class names!
[FEATURE] Extbase (Domain): Implemented FrontendUserGroup (no comma separated lists yet, only on usergroup possible)
[+BUGFIX] Extbase (Persistence): Fixed wrong tablenames in *_mm tables. Thanks to Christian Mueller who provided a patch. Resolves #3974.
[+BUGFIX] Extbase (Persistence): Fixed Query::lessThan, Query::lessThanOrEqual, Query::greaterThan. Resolves #3960.
[~FEATURE] Extbase (Persistence): Support for mm_opposite_field. Related to #3947.
[-API] Extbase (DomainModel): Removed getIdentifier() from AbstractDomainObject.
[-TASK] Extbase (Persistence): Removed unused DataMapperInterface.
[+API] Extbase (Persistence): Re-added possibility to set "useStoragePageId" in $queryFactory->create($className, $useStoragePageId).
[~TASK] Extbase: Messed up with the QuerySettings ;-) Will be fixed later.

26 files changed:
typo3/sysext/extbase/Classes/Domain/Model/FrontendUser.php
typo3/sysext/extbase/Classes/Domain/Model/FrontendUserGroup.php
typo3/sysext/extbase/Classes/Domain/Model/FrontendUserRepository.php [deleted file]
typo3/sysext/extbase/Classes/Domain/Repository/FrontendUserGroupRepository.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Domain/Repository/FrontendUserRepository.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php
typo3/sysext/extbase/Classes/MVC/Controller/Argument.php
typo3/sysext/extbase/Classes/Persistence/Backend.php
typo3/sysext/extbase/Classes/Persistence/DataMapperInterface.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/LazyLoadingProxy.php
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMap.php
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php
typo3/sysext/extbase/Classes/Persistence/QOM/QueryObjectModel.php
typo3/sysext/extbase/Classes/Persistence/QOM/QueryObjectModelInterface.php
typo3/sysext/extbase/Classes/Persistence/Query.php
typo3/sysext/extbase/Classes/Persistence/QueryFactory.php
typo3/sysext/extbase/Classes/Persistence/QueryFactoryInterface.php
typo3/sysext/extbase/Classes/Persistence/QuerySettingsInterface.php
typo3/sysext/extbase/Classes/Persistence/Repository.php
typo3/sysext/extbase/Classes/Persistence/Storage/BackendSpecificQuerySettingsInterface.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/Storage/QuerySettingsInterface.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbBackend.php
typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbSpecificQuerySettings.php [deleted file]
typo3/sysext/extbase/Classes/Persistence/Storage/Typo3QuerySettings.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/AbstractCompositeValidator.php
typo3/sysext/extbase/ext_typoscript_setup.txt

index ef92f99..8831a56 100644 (file)
@@ -46,7 +46,7 @@ class Tx_Extbase_Domain_Model_FrontendUser extends Tx_Extbase_DomainObject_Abstr
        /**
         * @var Tx_Extbase_Domain_Model_FrontendUserGroup
         */
-//     protected $usergroup;
+       protected $usergroup;
 
        /**
         * @var string
index 1b2cec8..e9a27f6 100644 (file)
@@ -51,7 +51,7 @@ class Tx_Extbase_Domain_Model_FrontendUserGroup extends Tx_Extbase_DomainObject_
        /**
         * @var string
         */
-//     protected $subgroup;
+       protected $subgroup;
 
        /**
         * Constructs a new Frontend User Group
diff --git a/typo3/sysext/extbase/Classes/Domain/Model/FrontendUserRepository.php b/typo3/sysext/extbase/Classes/Domain/Model/FrontendUserRepository.php
deleted file mode 100644 (file)
index 056e92f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
- *  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.
- *
- *  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!
- ***************************************************************/
-
-/**
- * A Frontend User repository
- *
- * @package Extbase
- * @subpackage Domain
- * @version $Id: $
- */
-class Tx_Extbase_Domain_Model_FrontendUserRepository extends Tx_Extbase_Persistence_Repository {
-       
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Domain/Repository/FrontendUserGroupRepository.php b/typo3/sysext/extbase/Classes/Domain/Repository/FrontendUserGroupRepository.php
new file mode 100644 (file)
index 0000000..150ce89
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+ *  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.
+ *
+ *  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!
+ ***************************************************************/
+
+/**
+ * A Frontend User repository
+ *
+ * @package Extbase
+ * @subpackage Domain
+ * @version $Id: $
+ */
+class Tx_Extbase_Domain_Repository_FrontendUserRepository extends Tx_Extbase_Persistence_Repository {
+       
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Domain/Repository/FrontendUserRepository.php b/typo3/sysext/extbase/Classes/Domain/Repository/FrontendUserRepository.php
new file mode 100644 (file)
index 0000000..150ce89
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+ *  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.
+ *
+ *  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!
+ ***************************************************************/
+
+/**
+ * A Frontend User repository
+ *
+ * @package Extbase
+ * @subpackage Domain
+ * @version $Id: $
+ */
+class Tx_Extbase_Domain_Repository_FrontendUserRepository extends Tx_Extbase_Persistence_Repository {
+       
+}
+?>
\ No newline at end of file
index 14b16b7..4dc6d3c 100644 (file)
@@ -77,15 +77,6 @@ abstract class Tx_Extbase_DomainObject_AbstractDomainObject implements Tx_Extbas
        }
 
        /**
-        * Getter for the identifier
-        *
-        * @return int the uid or NULL if none set yet.
-        */
-       final public function getIdentifier() {
-               return ($this->uid === NULL ? NULL : (int)$this->uid);
-       }
-
-       /**
         * Reconstitutes a property. Only for internal use.
         *
         * @param string $propertyName
index 7a97124..5ba1632 100644 (file)
@@ -303,15 +303,15 @@ class Tx_Extbase_MVC_Controller_Argument {
         * @return mixed Either the object matching the uid or, if none or more than one object was found, FALSE
         */
        protected function findObjectByUid($uid) {
-                $query = $this->queryFactory->create($this->dataType);
-                $result = current($query->matching($query->withUid($uid))->execute());
-                 // TODO Check if the object is an Aggregate Root (this can be quite difficult because we have no Repository registration 
-                if (is_object($result)) {
-                       $this->persistenceManager->getSession()->registerReconstitutedObject($result);
-                       return $result;
-                } else {
-                       return FALSE;
-                }
+               $query = $this->queryFactory->create($this->dataType, FALSE);
+               $result = $query->matching($query->withUid($uid))->execute();
+               $object = NULL;
+               if (count($result) > 0) {
+                       $object = current($result);
+                       // TODO Check if the object is an Aggregate Root (this can be quite difficult because we have no Repository registration 
+                       $this->persistenceManager->getSession()->registerReconstitutedObject($object);
+               }
+               return $object;         
        }
 
        /**
index 1366599..5a1db97 100644 (file)
@@ -399,7 +399,7 @@ class Tx_Extbase_Persistence_Backend implements Tx_Extbase_Persistence_BackendIn
                $row = array(
                        $columnMap->getParentKeyFieldName() => (int)$parentObject->getUid(),
                        $columnMap->getChildKeyFieldName() => (int)$relatedObject->getUid(),
-                       'tablenames' => $dataMap->getTableName(),
+                       'tablenames' => $columnMap->getChildTableName(),
                        'sorting' => 9999 // TODO sorting of mm table items
                        );
                $res = $this->storageBackend->addRow(
diff --git a/typo3/sysext/extbase/Classes/Persistence/DataMapperInterface.php b/typo3/sysext/extbase/Classes/Persistence/DataMapperInterface.php
deleted file mode 100644 (file)
index 680abfd..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-*  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.
-*
-*  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!
-***************************************************************/
-
-/**
- * A data mapper interface.
- *
- * @package Extbase
- * @subpackage extbase
- * @version $ID:$
- */
-// SK: Is this interface used anywhere? I guess not.
-interface Tx_Extbase_Persistence_DataMapperInterface {
-
-       /**
-        * Sets the aggregate root objects. The aggregate root objects are a starting point to traverse the 
-        * object graph.
-        *
-        * @param Tx_Extbase_Persistence_ObjectStorage $objects The objects to be registered
-        * @return void
-        */
-       public function setAggregateRootObjects(Tx_Extbase_Persistence_ObjectStorage $objects);
-       
-       /**
-        * Sets the deleted objects.
-        *
-        * @param Tx_Extbase_Persistence_ObjectStorage $objects The objects to be deleted
-        * @return void
-        */
-       public function setDeletedObjects(Tx_Extbase_Persistence_ObjectStorage $objects);
-
-       /**
-        * Persists all objects traversing the object graph.
-        *
-        * @return void
-        */
-       public function persistObjects();
-
-       /**
-        * Processes all deleted objects.
-        *
-        * @return void
-        */
-       public function processDeletedObjects();
-
-}
-?>
\ No newline at end of file
index 0904c77..a358e64 100644 (file)
@@ -88,12 +88,18 @@ class Tx_Extbase_Persistence_LazyLoadingProxy {
                $objectStorage = new Tx_Extbase_Persistence_ObjectStorage();
                // TODO This if statement should be further encapsulated to follow the DRY principle (see Data Mapper)
                if ($columnMap->getTypeOfRelation() === Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_ONE) {
-                       $query = $this->queryFactory->create($columnMap->getChildClassName());
+                       $query = $this->queryFactory->create($columnMap->getChildClassName(), FALSE);
                        $result = current($query->matching($query->withUid($row[$columnMap->getColumnName()]))->execute());
                } elseif ($columnMap->getTypeOfRelation() === Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_MANY) {
                        $objectStorage = new Tx_Extbase_Persistence_ObjectStorage();
-                       $query = $this->queryFactory->create($columnMap->getChildClassName());
-                       $objects = $query->matching($query->equals($columnMap->getParentKeyFieldName(), $this->parentObject->getUid()))->execute();
+                       $query = $this->queryFactory->create($columnMap->getChildClassName(), FALSE);
+                       $parentKeyFieldName = $columnMap->getParentKeyFieldName();
+                       if (isset($parentKeyFieldName)) {
+                               $objects = $query->matching($query->equals($columnMap->getParentKeyFieldName(), $this->parentObject->getUid()))->execute();
+                       } else {
+                               $propertyValue = $row[$propertyName];
+                               $objects = $query->matching($query->withUid((int)$propertyValue))->execute();
+                       }
                        foreach ($objects as $object) {
                                $objectStorage->attach($object);
                        }
@@ -106,14 +112,14 @@ class Tx_Extbase_Persistence_LazyLoadingProxy {
                        $right = $this->QOMFactory->selector($childTableName);
                        $joinCondition = $this->QOMFactory->equiJoinCondition($relationTableName, $columnMap->getChildKeyFieldName(), $childTableName, 'uid');
                        $source = $this->QOMFactory->join(
-                       $left,
-                       $right,
-                       Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_INNER,
-                       $joinCondition
-                       );
-                       $query = $this->queryFactory->create($columnMap->getChildClassName());
+                               $left,
+                               $right,
+                               Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_INNER,
+                               $joinCondition
+                               );
+                       $query = $this->queryFactory->create($columnMap->getChildClassName(), FALSE);
                        $query->setSource($source);
-                       $objects = $query->matching($query->equals($columnMap->getChildKeyFieldName(), $this->parentObject->getUid()))->execute();
+                       $objects = $query->matching($query->equals($columnMap->getParentKeyFieldName(), $this->parentObject->getUid()))->execute();
                        foreach ($objects as $object) {
                                $objectStorage->attach($object);
                        }
index cb09227..990f455 100644 (file)
@@ -121,6 +121,9 @@ class Tx_Extbase_Persistence_Mapper_DataMap {
                                } else {
                                        $propertyName = t3lib_div::underscoredToLowerCamelCase($columnName);
                                }
+                               if (isset($mapping[$columnName]['foreignClass']) && !isset($columnConfiguration['config']['foreign_class'])) {
+                                       $columnConfiguration['config']['foreign_class'] = $mapping[$columnName]['foreignClass'];
+                               }
                                $columnMap = new Tx_Extbase_Persistence_Mapper_ColumnMap($columnName, $propertyName);
                                $this->setPropertyType($columnMap, $columnConfiguration);
                                // TODO Check support for IRRE
@@ -178,7 +181,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap {
                } elseif (in_array('double2', $evalConfiguration)) {
                        $columnMap->setPropertyType(Tx_Extbase_Persistence_PropertyType::DOUBLE);
                } else {
-                       if (isset($columnConfiguration['config']['foreign_table']) && isset($columnConfiguration['config']['foreign_class'])) {
+                       if (isset($columnConfiguration['config']['foreign_table'])) {
                                if ($columnConfiguration['config']['loadingStrategy'] === 'proxy') {
                                        $columnMap->setLoadingStrategy(Tx_Extbase_Persistence_Mapper_ColumnMap::STRATEGY_PROXY);
                                } else {
@@ -225,7 +228,7 @@ class Tx_Extbase_Persistence_Mapper_DataMap {
                        $columnMap->setChildTableName($columnConfiguration['config']['foreign_table']);
                        $columnMap->setRelationTableName($columnConfiguration['config']['MM']);
                        // TODO We currently do not support multi table relationships
-                       if ($columnConfiguration['config']['MM_opposite_field']) {      // in case of a reverse relation
+                       if ($columnConfiguration['config']['MM_opposite_field']) {
                                $columnMap->setParentKeyFieldName('uid_foreign');
                                $columnMap->setChildKeyFieldName('uid_local');
                                $columnMap->setChildSortByFieldName('sorting_foreign');
index 11c63bd..c7899db 100644 (file)
@@ -1,26 +1,26 @@
 <?php
 /***************************************************************
-*  Copyright notice
-*
-*  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-*  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.
-*
-*  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!
-***************************************************************/
+ *  Copyright notice
+ *
+ *  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+ *  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.
+ *
+ *  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!
+ ***************************************************************/
 
 /**
  * A mapper to map database tables configured in $TCA on domain objects.
@@ -73,7 +73,6 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
         */
        public function __construct() {
                $this->queryFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_QueryFactory');
-               $GLOBALS['TSFE']->includeTCA(); // TODO Move this to an appropriate position
        }
 
        /**
@@ -169,10 +168,10 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                                case Tx_Extbase_Persistence_PropertyType::LONG;
                                case Tx_Extbase_Persistence_PropertyType::DOUBLE;
                                case Tx_Extbase_Persistence_PropertyType::BOOLEAN;
-                                       if (isset($row[$columnName])) {
-                                               $rawPropertyValue = $row[$columnName];
-                                               $propertyValue = $dataMap->convertFieldValueToPropertyValue($propertyType, $rawPropertyValue);
-                                       }
+                               if (isset($row[$columnName])) {
+                                       $rawPropertyValue = $row[$columnName];
+                                       $propertyValue = $dataMap->convertFieldValueToPropertyValue($propertyType, $rawPropertyValue);
+                               }
                                break;
                                case (Tx_Extbase_Persistence_PropertyType::REFERENCE):
                                        if (!is_null($row[$columnName])) {
@@ -180,7 +179,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                                        } else {
                                                $propertyValue = NULL;
                                        }
-                               break;
+                                       break;
                                        // FIXME we have an object to handle... -> exception
                                default:
                                        // SK: We should throw an exception as this point as there was an undefined propertyType we can not handle.
@@ -194,7 +193,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                                                        $propertyValue = $this->mapSingleRow($className, $property);
                                                }
                                        }
-                               break;
+                                       break;
                        }
 
                        $object->_setProperty($propertyName, $propertyValue);
@@ -212,18 +211,24 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
         */
        protected function mapRelatedObjects(Tx_Extbase_DomainObject_AbstractEntity $parentObject, $propertyName, Tx_Extbase_Persistence_RowInterface $row, Tx_Extbase_Persistence_Mapper_ColumnMap $columnMap) {
                $dataMap = $this->getDataMap(get_class($parentObject));
-               $columnMap = $dataMap->getColumnMap($propertyName);
+               $columnMap = $dataMap->getColumnMap($propertyName);             
                if ($columnMap->getLoadingStrategy() === Tx_Extbase_Persistence_Mapper_ColumnMap::STRATEGY_PROXY) {
                        // TODO Remove dependency to the loading strategy implementation
                        $result = t3lib_div::makeInstance('Tx_Extbase_Persistence_LazyLoadingProxy', $parentObject, $propertyName, $dataMap);
                } else {
                        if ($columnMap->getTypeOfRelation() === Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_ONE) {
-                               $query = $this->queryFactory->create($columnMap->getChildClassName());
+                               $query = $this->queryFactory->create($columnMap->getChildClassName(), FALSE);
                                $result = current($query->matching($query->withUid($row[$columnMap->getColumnName()]))->execute());
                        } elseif ($columnMap->getTypeOfRelation() === Tx_Extbase_Persistence_Mapper_ColumnMap::RELATION_HAS_MANY) {
                                $objectStorage = new Tx_Extbase_Persistence_ObjectStorage();
-                               $query = $this->queryFactory->create($columnMap->getChildClassName());
-                               $objects = $query->matching($query->equals($columnMap->getParentKeyFieldName(), $parentObject->getUid()))->execute();
+                               $query = $this->queryFactory->create($columnMap->getChildClassName(), FALSE);
+                               $parentKeyFieldName = $columnMap->getParentKeyFieldName();
+                               if (isset($parentKeyFieldName)) {
+                                       $objects = $query->matching($query->equals($columnMap->getParentKeyFieldName(), $parentObject->getUid()))->execute();
+                               } else {
+                                       $propertyValue = $row[$propertyName];
+                                       $objects = $query->matching($query->withUid((int)$propertyValue))->execute();
+                               }
                                foreach ($objects as $object) {
                                        $objectStorage->attach($object);
                                }
@@ -241,7 +246,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_JOIN_TYPE_INNER,
                                        $joinCondition
                                        );
-                               $query = $this->queryFactory->create($columnMap->getChildClassName());
+                               $query = $this->queryFactory->create($columnMap->getChildClassName(), FALSE);
                                $query->setSource($source);
                                $objects = $query->matching($query->equals($columnMap->getParentKeyFieldName(), $parentObject->getUid()))->execute();
                                foreach ($objects as $object) {
@@ -273,7 +278,6 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
         * @return Tx_Extbase_Persistence_Mapper_DataMap The data map
         */
        public function getDataMap($className) {
-               global $TCA;
                if (empty($this->dataMaps[$className])) {
                        // FIXME This is a costy for table name aliases -> implement a DataMapBuilder (knowing the aliases defined in $TCA)
                        $mapping = array();
@@ -284,13 +288,15 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                                foreach (class_parents($className) as $parentClassName) {
                                        if (isset($extbaseSettings['classes'][$parentClassName]) && !empty($extbaseSettings['classes'][$parentClassName]['mapping']['tableName'])) {
                                                $tableName = $extbaseSettings['classes'][$parentClassName]['mapping']['tableName'];
-                                               $mapping = $extbaseSettings['classes'][$parentClassName]['mapping']['columns'];
                                                break;
                                        }
                                        // TODO throw Exception
                                }
                        }
-                       
+                       if (is_array($extbaseSettings['classes'][$parentClassName]['mapping']['columns'])) {
+                               $mapping = $extbaseSettings['classes'][$parentClassName]['mapping']['columns'];
+                       }
+
                        $dataMap = new Tx_Extbase_Persistence_Mapper_DataMap($className, $tableName, $mapping);
                        $this->dataMaps[$className] = $dataMap;
                }
index 87d8f8c..8d4aab9 100644 (file)
@@ -108,9 +108,9 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModel implements Tx_Extbase_Persiste
        
        /**
         * Backend specific query settings
-        * @var Tx_Extbase_Persistence_Storage_BackendSpecificQuerySettingsInterface
+        * @var Tx_Extbase_Persistence_Storage_QuerySettingsInterface
         */
-       protected $backendSpecificQuerySettings;
+       protected $querySettings;
 
        /**
         * Constructs this QueryObjectModel instance
@@ -119,14 +119,14 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModel implements Tx_Extbase_Persiste
         * @param Tx_Extbase_Persistence_QOM_ConstraintInterface $constraint (null if none)
         * @param array $orderings
         * @param array $columns
-        * @param Tx_Extbase_Persistence_Storage_BackendSpecificQuerySettingsInterface $backendSpecificQuerySettings Storage backend specific query settings (or NULL)
+        * @param Tx_Extbase_Persistence_Storage_QuerySettingsInterface $querySettings Storage backend specific query settings (or NULL)
         */
-       public function __construct(Tx_Extbase_Persistence_QOM_SourceInterface $selectorOrSource, $constraint, array $orderings, array $columns, $backendSpecificQuerySettings) {
+       public function __construct(Tx_Extbase_Persistence_QOM_SourceInterface $selectorOrSource, $constraint, array $orderings, array $columns, $querySettings) {
                $this->source = $selectorOrSource;
                $this->constraint = $constraint;
                $this->orderings = $orderings;
                $this->columns = $columns;
-               $this->backendSpecificQuerySettings = $backendSpecificQuerySettings;
+               $this->querySettings = $querySettings;
 
                if ($this->constraint !== NULL) {
                        $this->constraint->collectBoundVariableNames($this->boundVariables);
@@ -247,8 +247,8 @@ class Tx_Extbase_Persistence_QOM_QueryObjectModel implements Tx_Extbase_Persiste
         * 
         * @return Tx_Extbase_Persistence_Storage_BackendSpecificQuerySettingsInterface Backend specific query settings
         */
-       public function getBackendSpecificQuerySettings() {
-               return $this->backendSpecificQuerySettings;
+       public function getQuerySettings() {
+               return $this->querySettings;
        }
 
        /**
index 9a29c24..c573118 100644 (file)
@@ -91,9 +91,9 @@ interface Tx_Extbase_Persistence_QOM_QueryObjectModelInterface {
        /**
         * Backend specific query settings
         * 
-        * @return Tx_Extbase_Persistence_Storage_BackendSpecificQuerySettingsInterface Backend specific query settings
+        * @return Tx_Extbase_Persistence_Storage_QuerySettingsInterface Backend specific query settings
         */
-       public function getBackendSpecificQuerySettings();
+       public function getQuerySettings();
 
        /**
         * Binds the given value to the variable named $varName.
index 69997d1..3f31d08 100644 (file)
@@ -110,7 +110,7 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         */
        public function __construct($className) {
                $this->className = $className;
-               $this->backendSpecificQuerySettings = t3lib_div::makeInstance('Tx_Extbase_Persistence_Storage_Typo3DbSpecificQuerySettings');
+               $this->typo3QuerySettings = t3lib_div::makeInstance('Tx_Extbase_Persistence_Storage_Typo3QuerySettings');
        }
 
        /**
@@ -167,7 +167,7 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
                        $this->constraint,
                        $this->orderings,
                        $this->columns, // TODO implement selection of columns
-                       $this->backendSpecificQuerySettings
+                       $this->typo3QuerySettings
                );
                if ($this->limit !== NULL) {
                        $query->setLimit($this->limit);
@@ -290,14 +290,10 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         * @return Tx_Extbase_Persistence_QOM_ComparisonInterface
         */
        public function withUid($uid) {
-               if ($this->source === NULL) {
-                       $this->source = $this->QOMFactory->selector($this->dataMapper->convertClassNameToSelectorName($this->className));
-               }
-               $sourceSelectorName = $this->source->getSelectorName();
                $uniqueVariableName = $this->getUniqueVariableName('uid');
                $this->operands[$uniqueVariableName] = $uid;
                return $this->QOMFactory->comparison(
-                       $this->QOMFactory->propertyValue('uid', $sourceSelectorName),
+                       $this->QOMFactory->propertyValue('uid', $this->getSelectorName()),
                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_OPERATOR_EQUAL_TO,
                        $this->QOMFactory->bindVariable($uniqueVariableName)
                        );
@@ -313,11 +309,6 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         */
        public function equals($propertyName, $operand, $caseSensitive = TRUE) {
                $uniqueVariableName = uniqid($propertyName);
-               if ($this->source instanceof Tx_Extbase_Persistence_QOM_SelectorInterface) {
-                       $sourceSelectorName = $this->getSource()->getSelectorName();
-               }
-               // TODO $sourceSelectorName might not be initialized
-
                if (is_object($operand) && !($operand instanceof DateTime)) {
                        // FIXME This branch of if-then-else is not fully backported and non functional by now
                        $operand = $this->persistenceManager->getBackend()->getUidByObject($operand);
@@ -344,14 +335,14 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
                } else {
                        if ($caseSensitive) {
                                $comparison = $this->QOMFactory->comparison(
-                                       $this->QOMFactory->propertyValue($propertyName, $sourceSelectorName),
+                                       $this->QOMFactory->propertyValue($propertyName, $this->getSelectorName()),
                                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_OPERATOR_EQUAL_TO,
                                        $this->QOMFactory->bindVariable($uniqueVariableName)
                                        );
                        } else {
                                $comparison = $this->QOMFactory->comparison(
                                        $this->QOMFactory->lowerCase(
-                                               $this->QOMFactory->propertyValue($propertyName, $sourceSelectorName)
+                                               $this->QOMFactory->propertyValue($propertyName, $this->getSelectorName())
                                        ),
                                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_OPERATOR_EQUAL_TO,
                                        $this->QOMFactory->bindVariable($uniqueVariableName)
@@ -377,14 +368,9 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         */
        public function like($propertyName, $operand) {
                $uniqueVariableName = uniqid($propertyName);
-               if ($this->source instanceof Tx_Extbase_Persistence_QOM_SelectorInterface) {
-                       $sourceSelectorName = $this->getSource()->getSelectorName();
-               }
-               // TODO $sourceSelectorName might not be initialized
-
                $this->operands[$uniqueVariableName] = $operand;
                return $this->QOMFactory->comparison(
-                       $this->QOMFactory->propertyValue($propertyName, $sourceSelectorName),
+                       $this->QOMFactory->propertyValue($propertyName, $this->getSelectorName()),
                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_OPERATOR_LIKE,
                        $this->QOMFactory->bindVariable($uniqueVariableName)
                        );
@@ -398,11 +384,10 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         * @return Tx_Extbase_Persistence_QOM_ComparisonInterface
         */
        public function lessThan($propertyName, $operand) {
-               $sourceSelectorName = $this->source->getSelectorName();
                $uniqueVariableName = uniqid($propertyName);
                $this->operands[$uniqueVariableName] = $operand;
                return $this->QOMFactory->comparison(
-                       $this->QOMFactory->propertyValue($propertyName, $sourceSelectorName),
+                       $this->QOMFactory->propertyValue($propertyName, $this->getSelectorName()),
                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_OPERATOR_LESS_THAN,
                        $this->QOMFactory->bindVariable($uniqueVariableName)
                        );
@@ -416,11 +401,13 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         * @return Tx_Extbase_Persistence_QOM_ComparisonInterface
         */
        public function lessThanOrEqual($propertyName, $operand) {
-               $sourceSelectorName = $this->source->getSelectorName();
+               if ($this->source instanceof Tx_Extbase_Persistence_QOM_SelectorInterface) {
+                       $sourceSelectorName = $this->getSource()->getSelectorName();
+               }
                $uniqueVariableName = uniqid($propertyName);
                $this->operands[$uniqueVariableName] = $operand;
                return $this->QOMFactory->comparison(
-                       $this->QOMFactory->propertyValue($propertyName, $sourceSelectorName),
+                       $this->QOMFactory->propertyValue($propertyName, $this->getSelectorName()),
                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_OPERATOR_LESS_THAN_OR_EQUAL_TO,
                        $this->QOMFactory->bindVariable($uniqueVariableName)
                        );
@@ -434,11 +421,10 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         * @return Tx_Extbase_Persistence_QOM_ComparisonInterface
         */
        public function greaterThan($propertyName, $operand) {
-               $sourceSelectorName = $this->source->getSelectorName();
                $uniqueVariableName = uniqid($propertyName);
                $this->operands[$uniqueVariableName] = $operand;
                return $this->QOMFactory->comparison(
-                       $this->QOMFactory->propertyValue($propertyName, $sourceSelectorName),
+                       $this->QOMFactory->propertyValue($propertyName, $this->getSelectorName()),
                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_OPERATOR_GREATER_THAN,
                        $this->QOMFactory->bindVariable($uniqueVariableName)
                        );
@@ -452,11 +438,10 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         * @return Tx_Extbase_Persistence_QOM_ComparisonInterface
         */
        public function greaterThanOrEqual($propertyName, $operand) {
-               $sourceSelectorName = $this->source->getSelectorName();
                $uniqueVariableName = uniqid($propertyName);
                $this->operands[$uniqueVariableName] = $operand;
                return $this->QOMFactory->comparison(
-                       $this->QOMFactory->propertyValue($propertyName, $sourceSelectorName),
+                       $this->QOMFactory->propertyValue($propertyName, $this->getSelectorName()),
                        Tx_Extbase_Persistence_QOM_QueryObjectModelConstantsInterface::JCR_OPERATOR_GREATER_THAN_OR_EQUAL_TO,
                        $this->QOMFactory->bindVariable($uniqueVariableName)
                        );
@@ -468,10 +453,10 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
        
        /**
         * (non-PHPdoc)
-        * @see Classes/Persistence/Tx_Extbase_Persistence_Typo3QueryInterface#useStoragePage($useStoragePage)
+        * @see Classes/Persistence/Tx_Extbase_Persistence_QuerySettingsInterface#useStoragePageId($useStoragePageId)
         */
-       public function useStoragePage($useStoragePage) {
-               $this->backendSpecificQuerySettings->useStoragePage($useStoragePage);
+       public function useStoragePageId($useStoragePageId) {
+               $this->typo3QuerySettings->useStoragePageId($useStoragePageId);
                return this;
        }
        
@@ -480,9 +465,23 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
         * @see Classes/Persistence/Tx_Extbase_Persistence_Typo3QueryInterface#useEnableFields($useEnableFields)
         */
        public function useEnableFields($useEnableFields) {
-               $this->backendSpecificQuerySettings->useEnableFields($useEnableFields);
+               $this->typo3QuerySettings->useEnableFields($useEnableFields);
                return this;
        }
+       
+       /**
+        * Returns the selectorn name or null, if the source is not a selector
+        * // TODO This has to be checked at another place
+        * @return string The selector name
+        */
+       protected function getSelectorName() {
+               if ($this->source instanceof Tx_Extbase_Persistence_QOM_SelectorInterface) {
+                       return $this->source()->getSelectorName();
+               } else {
+                       return '';
+               }
+               
+       }
 
 }
 ?>
index 0acc35b..4fb2a54 100644 (file)
@@ -38,7 +38,7 @@ class Tx_Extbase_Persistence_QueryFactory implements Tx_Extbase_Persistence_Quer
         * @param boolean $useStoragePageId TRUE if queries should automatically be restricted to the current storage PID, FALSE otherwise.
         * @return Tx_Extbase_Persistence_QueryInterface
         */
-       public function create($className) {
+       public function create($className, $useStoragePageId) {
                $persistenceManager = Tx_Extbase_Dispatcher::getPersistenceManager();
 
                $dataMapper = t3lib_div::makeInstance('Tx_Extbase_Persistence_Mapper_DataMapper');
@@ -48,6 +48,8 @@ class Tx_Extbase_Persistence_QueryFactory implements Tx_Extbase_Persistence_Quer
                $query = t3lib_div::makeInstance('Tx_Extbase_Persistence_Query', $className);
                $query->injectPersistenceManager($persistenceManager);
                $query->injectDataMapper($dataMapper);
+               $query->useStoragePageId($useStoragePageId);
+
                return $query;
        }
 }
index b31953c..f51f757 100644 (file)
@@ -38,9 +38,10 @@ interface Tx_Extbase_Persistence_QueryFactoryInterface {
         * Creates a query object working on the given class name
         *
         * @param string $className The class name
+        * @param boolean $useStoragePageId If FALSE, will NOT add pid=... to the query. TRUE by default. Only change if you know what you are doing.
         * @return Tx_Extbase_Persistence_QueryInterface
         */
-       public function create($className);
+       public function create($className, $useStoragePageId);
 
 }
 ?>
\ No newline at end of file
index 5b61610..ec935fa 100644 (file)
@@ -38,10 +38,10 @@ interface Tx_Extbase_Persistence_QuerySettingsInterface {
        /**
         * Use storage page
         * 
-        * @param $useStoragePage if TRUE, should use storage PID. use FALSE to disable the storage Page ID checking 
+        * @param $useStoragePageId if TRUE, should use storage PID. use FALSE to disable the storage Page ID checking 
         * @return void
         */
-       public function useStoragePage($useStoragePage);
+       public function useStoragePageId($useStoragePageId);
        
        /**
         * Use enable fields
index 0a0db25..e0bd9ca 100644 (file)
@@ -51,6 +51,7 @@ class Tx_Extbase_Persistence_Repository implements Tx_Extbase_Persistence_Reposi
        public function __construct() {
                $this->persistenceManager = Tx_Extbase_Dispatcher::getPersistenceManager();
                $this->queryFactory = t3lib_div::makeInstance('Tx_Extbase_Persistence_QueryFactory'); // singleton
+               $this->objectType = str_replace(array('_Repository_', 'Repository'), array('_Model_', ''), $this->getRepositoryClassName());
        }
 
        /**
@@ -118,9 +119,7 @@ class Tx_Extbase_Persistence_Repository implements Tx_Extbase_Persistence_Reposi
        public function findByUid($uid) {
                if (!is_int($uid) || $uid < 0) throw new InvalidArgumentException('The uid must be a positive integer', 1245071889);
                $query = $this->createQuery();
-               $result = $query->matching($query->withUid($uid))
-                       ->setLimit(1)
-                       ->execute();
+               $result = $query->matching($query->withUid($uid))->execute();
                $object = NULL;
                if (count($result) > 0) {
                        $object = current($result);
@@ -134,20 +133,12 @@ class Tx_Extbase_Persistence_Repository implements Tx_Extbase_Persistence_Reposi
         *
         * @param boolean $useStoragePageId If FALSE, will NOT add pid=... to the query. TRUE by default. Only change if you know what you are doing.
         * @return Tx_Extbase_Persistence_QueryInterface
+        * @api
         */
        public function createQuery($useStoragePageId = TRUE) {
-               $repositoryClassName = $this->getRepositoryClassName();
-               if (substr($repositoryClassName, -10) === 'Repository' && substr($repositoryClassName, -11, 1) !== '_') {
-                       $type = substr($repositoryClassName, 0, -10);
-               } else {
-                       throw new Tx_Extbase_Exception('The domain repository wasn\'t able to resolve the target class name.', 1237897039);
-               }
-               if (!in_array('Tx_Extbase_DomainObject_DomainObjectInterface', class_implements($type))) {
-                       throw new Tx_Extbase_Exception('The domain repository tried to manage objects which are not implementing the Tx_Extbase_DomainObject_DomainObjectInterface.', 1237897039);
-               }
-               return $this->queryFactory->create($type, $useStoragePageId);
+               return $this->queryFactory->create($this->objectType, $useStoragePageId = TRUE);
        }
-
+       
        /**
         * Dispatches magic methods (findBy[Property]())
         *
diff --git a/typo3/sysext/extbase/Classes/Persistence/Storage/BackendSpecificQuerySettingsInterface.php b/typo3/sysext/extbase/Classes/Persistence/Storage/BackendSpecificQuerySettingsInterface.php
deleted file mode 100644 (file)
index 8d4195b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-*  All rights reserved
-*
-*  This class is a backport of the corresponding class of FLOW3.
-*  All credits go to the v5 team.
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * Marker interface for backend specific query options
- *
- * @package Extbase
- * @subpackage Persistence
- * @version $Id: BackendInterface.php 2120 2009-04-02 10:06:31Z k-fish $
- */
-interface Tx_Extbase_Persistence_Storage_BackendSpecificQuerySettingsInterface {
-
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Persistence/Storage/QuerySettingsInterface.php b/typo3/sysext/extbase/Classes/Persistence/Storage/QuerySettingsInterface.php
new file mode 100644 (file)
index 0000000..4a8800e
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+*  All rights reserved
+*
+*  This class is a backport of the corresponding class of FLOW3.
+*  All credits go to the v5 team.
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Marker interface for backend specific query options
+ *
+ * @package Extbase
+ * @subpackage Persistence
+ * @version $Id: BackendInterface.php 2120 2009-04-02 10:06:31Z k-fish $
+ */
+interface Tx_Extbase_Persistence_Storage_QuerySettingsInterface extends Tx_Extbase_Persistence_QuerySettingsInterface {
+
+}
+?>
\ No newline at end of file
index 520f4bf..119d39f 100644 (file)
@@ -255,10 +255,10 @@ class Tx_Extbase_Persistence_Storage_Typo3DbBackend implements Tx_Extbase_Persis
                        $sql['fields'][] = $selectorName . '.*';
                        $sql['tables'][] = $selectorName;
                        $extbaseSettings = Tx_Extbase_Dispatcher::getSettings();
-                       if ($query->getBackendSpecificQuerySettings()->enableFieldsEnabled()) {
+                       if ($query->getQuerySettings()->enableFieldsEnabled()) {
                                $this->addEnableFieldsStatement($selectorName, $sql);
                        }
-                       if ($query->getBackendSpecificQuerySettings()->storagePageEnabled()) {
+                       if ($query->getQuerySettings()->storagePageEnabled()) {
                                $sql['enableFields'][] = $selectorName . '.pid=' . intval($extbaseSettings['storagePid']);
                        }
                } elseif ($source instanceof Tx_Extbase_Persistence_QOM_JoinInterface) {
diff --git a/typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbSpecificQuerySettings.php b/typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbSpecificQuerySettings.php
deleted file mode 100644 (file)
index e2c54e7..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
-*  All rights reserved
-*
-*  This class is a backport of the corresponding class of FLOW3.
-*  All credits go to the v5 team.
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * TYPO3 DB specific query settings like use of a PID
- *
- * @package Extbase
- * @subpackage Persistence
- * @version $Id: BackendInterface.php 2120 2009-04-02 10:06:31Z k-fish $
- */
-class Tx_Extbase_Persistence_Storage_Typo3DbSpecificQuerySettings implements Tx_Extbase_Persistence_Storage_BackendSpecificQuerySettingsInterface {
-
-       protected $useStoragePage = TRUE;
-
-       protected $useEnableFields = TRUE;
-       
-       protected $storagePageId;
-       
-       public function useStoragePage($useStoragePage) {
-               $this->useStoragePage = (boolean)$useStoragePage;
-       }
-       
-       public function storagePageEnabled() {
-               return $this->useStoragePage;
-       }
-
-       public function getStoragePageId() {
-               return $this->storagePageId;
-       }
-       public function setStoragePageId($storagePageId) {
-               $this->storagePageId = $storagePageId;
-       }
-       public function enableFieldsEnabled() {
-               return $this->useEnableFields;
-       }
-       public function useEnableFields($useEnableFields) {
-               $this->useEnableFields = $useEnableFields;
-       }
-}
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Persistence/Storage/Typo3QuerySettings.php b/typo3/sysext/extbase/Classes/Persistence/Storage/Typo3QuerySettings.php
new file mode 100644 (file)
index 0000000..890dcc1
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
+*  All rights reserved
+*
+*  This class is a backport of the corresponding class of FLOW3.
+*  All credits go to the v5 team.
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * TYPO3 DB specific query settings like use of a PID
+ *
+ * @package Extbase
+ * @subpackage Persistence
+ * @version $Id: BackendInterface.php 2120 2009-04-02 10:06:31Z k-fish $
+ */
+class Tx_Extbase_Persistence_Storage_Typo3QuerySettings implements Tx_Extbase_Persistence_Storage_QuerySettingsInterface {
+
+       protected $useStoragePageId = TRUE;
+
+       protected $useEnableFields = TRUE;
+       
+       protected $storagePageId;
+       
+       public function useStoragePageId($useStoragePageId) {
+               $this->useStoragePageId = (boolean)$useStoragePageId;
+       }
+       
+       public function storagePageEnabled() {
+               return $this->useStoragePage;
+       }
+
+       public function getStoragePageId() {
+               return $this->storagePageId;
+       }
+       public function setStoragePageId($storagePageId) {
+               $this->storagePageId = $storagePageId;
+       }
+       public function enableFieldsEnabled() {
+               return $this->useEnableFields;
+       }
+       public function useEnableFields($useEnableFields) {
+               $this->useEnableFields = $useEnableFields;
+       }
+}
+?>
\ No newline at end of file
index 7d0e067..997fbef 100644 (file)
@@ -48,7 +48,7 @@ abstract class Tx_Extbase_Validation_Validator_AbstractCompositeValidator implem
        protected $options = array();
 
        /**
-        * @var SPLObjectStorage
+        * @var Tx_Extbase_Persistence_ObjectStorage
         */
        protected $validators;
 
@@ -62,7 +62,7 @@ abstract class Tx_Extbase_Validation_Validator_AbstractCompositeValidator implem
         *
         */
        public function __construct() {
-               $this->validators = new SPLObjectStorage();
+               $this->validators = new Tx_Extbase_Persistence_ObjectStorage();
        }
 
        /**
index c7bdf0a..119d85b 100644 (file)
@@ -12,14 +12,16 @@ config.tx_extbase {
                        mapping {
                                tableName = fe_users
                                columns {
+                                       usergroup.foreignClass = Tx_Extbase_Domain_Model_FrontendUserGroup
                                        lockToDomain.mapOnProperty = lockToDomain
                                }
                        }
                }
                Tx_Extbase_Domain_Model_FrontendUserGroup {
                        mapping {
-                               tableName = fe_users
+                               tableName = fe_groups
                                columns {
+                                       subgroup.foreignClass = Tx_Extbase_Domain_Model_FrontendUserGroup
                                        lockToDomain.mapOnProperty = lockToDomain
                                }
                        }