[+BUGFIX] Extbase (Reflection): Fixed buildClassSchema() to prevent a PHP warning.
authorSebastian Kurfürst <sebastian@typo3.org>
Mon, 14 Sep 2009 17:11:56 +0000 (17:11 +0000)
committerSebastian Kurfürst <sebastian@typo3.org>
Mon, 14 Sep 2009 17:11:56 +0000 (17:11 +0000)
typo3/sysext/extbase/Classes/MVC/Controller/ActionController.php
typo3/sysext/extbase/Classes/Reflection/Service.php

index 21ad9c5..d201ea6 100644 (file)
@@ -157,6 +157,7 @@ class Tx_Extbase_MVC_Controller_ActionController extends Tx_Extbase_MVC_Controll
                        } elseif ($parameterInfo['array']) {
                                $dataType = 'array';
                        }
                        } elseif ($parameterInfo['array']) {
                                $dataType = 'array';
                        }
+                       // TODO Exception here if type has not been determined!
                        $defaultValue = (isset($parameterInfo['defaultValue']) ? $parameterInfo['defaultValue'] : NULL);
 
                        $this->arguments->addNewArgument($parameterName, $dataType, ($parameterInfo['optional'] === FALSE), $defaultValue);
                        $defaultValue = (isset($parameterInfo['defaultValue']) ? $parameterInfo['defaultValue'] : NULL);
 
                        $this->arguments->addNewArgument($parameterName, $dataType, ($parameterInfo['optional'] === FALSE), $defaultValue);
index 463b072..8fafc48 100644 (file)
@@ -380,9 +380,12 @@ class Tx_Extbase_Reflection_Service implements t3lib_Singleton {
        /**
         * Builds class schemata from classes annotated as entities or value objects
         *
        /**
         * Builds class schemata from classes annotated as entities or value objects
         *
-        * @return void
+        * @return Tx_Extbase_Reflection_ClassSchema The class schema
         */
        protected function buildClassSchema($className) {
         */
        protected function buildClassSchema($className) {
+               if (!class_exists($classSchema)) {
+                       return NULL;
+               }
                $classSchema = new Tx_Extbase_Reflection_ClassSchema($className);
                if (is_subclass_of($className, 'Tx_Extbase_DomainObject_AbstractEntity')) {
                        $classSchema->setModelType(Tx_Extbase_Reflection_ClassSchema::MODELTYPE_ENTITY);
                $classSchema = new Tx_Extbase_Reflection_ClassSchema($className);
                if (is_subclass_of($className, 'Tx_Extbase_DomainObject_AbstractEntity')) {
                        $classSchema->setModelType(Tx_Extbase_Reflection_ClassSchema::MODELTYPE_ENTITY);
@@ -395,7 +398,6 @@ class Tx_Extbase_Reflection_Service implements t3lib_Singleton {
                        $classSchema->setModelType(Tx_Extbase_Reflection_ClassSchema::MODELTYPE_VALUEOBJECT);
                } else {
                        return NULL;
                        $classSchema->setModelType(Tx_Extbase_Reflection_ClassSchema::MODELTYPE_VALUEOBJECT);
                } else {
                        return NULL;
-
                }
 
                foreach ($this->getClassPropertyNames($className) as $propertyName) {
                }
 
                foreach ($this->getClassPropertyNames($className) as $propertyName) {
@@ -510,4 +512,4 @@ class Tx_Extbase_Reflection_Service implements t3lib_Singleton {
                $this->cache->set('ReflectionData', $data);
        }
 }
                $this->cache->set('ReflectionData', $data);
        }
 }
-?>
\ No newline at end of file
+?>