[+FEATURE] Extbase (Persistence): Implemented recursive starting point/storage page...
authorJochen Rau <j.rau@web.de>
Thu, 18 Feb 2010 11:30:29 +0000 (11:30 +0000)
committerJochen Rau <j.rau@web.de>
Thu, 18 Feb 2010 11:30:29 +0000 (11:30 +0000)
typo3/sysext/extbase/Classes/Configuration/FrontendConfigurationManager.php
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php

index 9fcd600..cc11351 100644 (file)
@@ -79,11 +79,18 @@ class Tx_Extbase_Configuration_FrontendConfigurationManager extends Tx_Extbase_C
         * @return array the framework configuration with overriden storagePid
         */
        protected function overrideStoragePidIfStartingPointIsSet($frameworkConfiguration) {
-               if (is_string($this->contentObject->data['pages'])
-                   && strlen($this->contentObject->data['pages']) > 0) {
+               $pages = $this->contentObject->data['pages'];
+               if (is_string($pages) && strlen($pages) > 0) {
+                       $list = array();
+                       if($this->contentObject->data['recursive'] > 0) {
+                               $explodedPages = t3lib_div::trimExplode(',', $pages);
+                               foreach($explodedPages as $pid) {
+                                       $list[] = trim($this->contentObject->getTreeList($pid, $this->contentObject->data['recursive']), ',');
+                               }
+                       }
                        $frameworkConfiguration = t3lib_div::array_merge_recursive_overrule($frameworkConfiguration, array(
                                'persistence' => array(
-                                       'storagePid' => $this->contentObject->data['pages']
+                                       'storagePid' => $pages . implode(',', $list)
                                )
                        ));
                }
index 63e6ea3..e01f9ef 100644 (file)
@@ -491,7 +491,7 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                } else {
                        throw new Tx_Extbase_Persistence_Exception_UnexpectedTypeException('Could not determine the child object object type.', 1251315967);
                }
-               return $elementType;            
+               return $elementType;    
        }
 
        /**