[+FEATURE] Extbase (Persistence): Extbase respects type annotations of model paramete...
authorJochen Rau <j.rau@web.de>
Thu, 18 Feb 2010 11:30:23 +0000 (11:30 +0000)
committerJochen Rau <j.rau@web.de>
Thu, 18 Feb 2010 11:30:23 +0000 (11:30 +0000)
typo3/sysext/extbase/Classes/Persistence/Mapper/DataMapper.php

index 3f61d07..63e6ea3 100644 (file)
@@ -190,7 +190,14 @@ class Tx_Extbase_Persistence_Mapper_DataMapper implements t3lib_Singleton {
                        $columnMap = $dataMap->getColumnMap($propertyName);
                        $columnName = $columnMap->getColumnName();
                        $propertyValue = NULL;
-                       $propertyType = $columnMap->getPropertyType();
+                       
+                       $propertyMetaData = $this->reflectionService->getClassSchema($className)->getProperty($propertyName);
+                       $propertyType = Tx_Extbase_Persistence_PropertyType::valueFromType($propertyMetaData['type']);
+
+                       if ($propertyType == Tx_Extbase_Persistence_PropertyType::UNDEFINED) {
+                               $propertyType = $columnMap->getPropertyType();
+                       }
+
                        switch ($propertyType) {
                                case Tx_Extbase_Persistence_PropertyType::STRING;
                                case Tx_Extbase_Persistence_PropertyType::DATE;