Changeset 1896 for framework/trunk/src/main/php/net/stubbles/rdbms/persistence/stubPersistenceHelper.php
- Timestamp:
- 10/23/08 19:37:46 (23 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
framework/trunk/src/main/php/net/stubbles/rdbms/persistence/stubPersistenceHelper.php
r1763 r1896 77 77 return null; 78 78 } else { 79 $column = new stubDatabaseTableColumn();79 $column = new stubDatabaseTableColumn(); 80 80 $column->setName($this->getPropertyName($method->getName())); 81 81 $returnType = $method->getReturnType(); … … 86 86 87 87 if ($returnType instanceof stubReflectionClass) { 88 // not supported yet 89 throw new stubPersistenceException('Returning classes from entity getter methods is currently not supported. Sorry. :('); 90 } 91 92 switch ($returnType->value()) { 93 case 'int': 94 $column->setType('INT'); 95 $column->setSize(10); 96 break; 88 if ($returnType->getName() !== 'stubDate') { 89 // not supported yet 90 throw new stubPersistenceException('Returning classes from entity getter methods is currently not supported, except for net::stubbles::lang::types::stubDate. Sorry. :('); 91 } 97 92 98 case 'float': 99 $column->setType('FLOAT'); 100 $column->setSize(10); 101 break; 102 103 case 'bool': 104 $column->setType('TINYINT'); 105 $column->setSize(1); 106 break; 107 108 default: 109 $column->setType('VARCHAR'); 110 $column->setSize(255); 93 $column->setType('DATETIME'); 94 } else { 95 switch ($returnType->value()) { 96 case 'int': 97 $column->setType('INT'); 98 $column->setSize(10); 99 break; 100 101 case 'float': 102 $column->setType('FLOAT'); 103 $column->setSize(10); 104 break; 105 106 case 'bool': 107 $column->setType('TINYINT'); 108 $column->setSize(1); 109 break; 110 111 default: 112 $column->setType('VARCHAR'); 113 $column->setSize(255); 114 } 111 115 } 112 116 }
