Changeset 3879
- Timestamp:
- 02/21/08 18:42:01 (17 months ago)
- Location:
- branches/0.10/lib/Doctrine
- Files:
-
- 3 modified
-
Hydrator.php (modified) (2 diffs)
-
Record.php (modified) (1 diff)
-
Table.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/lib/Doctrine/Hydrator.php
r3755 r3879 300 300 $cache[$key]['isSimpleType'] = true; 301 301 } else { 302 $cache[$key]['type'] = $type; 302 303 $cache[$key]['isSimpleType'] = false; 303 304 } … … 320 321 $rowData[$dqlAlias][$fieldName] = $value; 321 322 } else { 322 $rowData[$dqlAlias][$fieldName] = $table->prepareValue($fieldName, $value); 323 $rowData[$dqlAlias][$fieldName] = $table->prepareValue( 324 $fieldName, $value, $cache[$key]['type']); 323 325 } 324 326 -
branches/0.10/lib/Doctrine/Record.php
r3708 r3879 1816 1816 $this->getNode()->delete(); 1817 1817 } 1818 1819 /** 1820 * Helps freeing the memory occupied by the entity. 1821 * Cuts all references the entity has to other entities and removes the entity 1822 * from the instance pool. 1823 * Note: The entity is no longer useable after free() has been called. Any operations 1824 * done with the entity afterwards can lead to unpredictable results. 1825 */ 1826 public function free() 1827 { 1828 $this->_table->getRepository()->evict($this->_oid); 1829 $this->_table->removeRecord($this); 1830 $this->_data = array(); 1831 $this->_id = array(); 1832 $this->_references = array(); 1833 } 1834 1818 1835 public function toString() 1819 1836 { -
branches/0.10/lib/Doctrine/Table.php
r3798 r3879 1639 1639 * @param string $field the name of the field 1640 1640 * @param string $value field value 1641 * @param string $typeHint Type hint used to pass in the type of the value to prepare 1642 * if it is already known. This enables the method to skip 1643 * the type determination. Used i.e. during hydration. 1641 1644 * @return mixed prepared value 1642 1645 */ 1643 public function prepareValue($fieldName, $value )1646 public function prepareValue($fieldName, $value, $typeHint = null) 1644 1647 { 1645 1648 if ($value === self::$_null) { … … 1648 1651 return null; 1649 1652 } else { 1650 $type = $this->getTypeOf($fieldName);1653 $type = is_null($typeHint) ? $this->getTypeOf($fieldName) : $typeHint; 1651 1654 1652 1655 switch ($type) {