Changeset 4964 for trunk/lib/Doctrine
- Timestamp:
- 09/13/08 13:40:17 (4 months ago)
- Location:
- trunk/lib/Doctrine
- Files:
-
- 1 added
- 2 removed
- 5 modified
-
Common/ClassLoader.php (added)
-
DBAL/Types/Type.php (modified) (1 diff)
-
Expression.php (deleted)
-
Manager.php (deleted)
-
ORM/Internal/Hydration/AbstractHydrator.php (modified) (1 diff)
-
ORM/Internal/Hydration/StandardHydrator.php (modified) (5 diffs)
-
Query.php (modified) (3 diffs)
-
Query/ParserRule.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Doctrine/DBAL/Types/Type.php
r4911 r4964 30 30 31 31 /** 32 * Factory method. 32 * Factory method to create type instances. 33 * Type instances are implemented as flyweights. 33 34 * 34 35 * @param string $name The name of the type (as returned by getName()). -
trunk/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php
r4962 r4964 55 55 * The current hydration mode. 56 56 */ 57 protected $_hydrationMode = Doctrine ::HYDRATE_RECORD;57 protected $_hydrationMode = Doctrine_Query::HYDRATE_OBJECT; 58 58 59 59 protected $_nullObject; -
trunk/lib/Doctrine/ORM/Internal/Hydration/StandardHydrator.php
r4930 r4964 90 90 $stmt = $parserResult->getDatabaseStatement(); 91 91 92 if ($hydrationMode == Doctrine ::HYDRATE_NONE) {92 if ($hydrationMode == Doctrine_Query::HYDRATE_NONE) { 93 93 return $stmt->fetchAll(PDO::FETCH_NUM); 94 94 } … … 97 97 $this->_queryComponents = $parserResult->getQueryComponents(); 98 98 99 if ($hydrationMode == Doctrine ::HYDRATE_ARRAY) {99 if ($hydrationMode == Doctrine_Query::HYDRATE_ARRAY) { 100 100 $driver = new Doctrine_ORM_Internal_Hydration_ArrayDriver(); 101 101 } else { … … 124 124 125 125 // Holds the resulting hydrated data structure 126 if ($parserResult->isMixedQuery() || $hydrationMode == Doctrine ::HYDRATE_SCALAR) {126 if ($parserResult->isMixedQuery() || $hydrationMode == Doctrine_Query::HYDRATE_SCALAR) { 127 127 $result = array(); 128 128 } else { … … 146 146 $cache = array(); 147 147 // Evaluate HYDRATE_SINGLE_SCALAR 148 if ($hydrationMode == Doctrine ::HYDRATE_SINGLE_SCALAR) {148 if ($hydrationMode == Doctrine_Query::HYDRATE_SINGLE_SCALAR) { 149 149 $result = $stmt->fetchAll(PDO::FETCH_ASSOC); 150 150 if (count($result) > 1 || count($result[0]) > 1) { … … 155 155 156 156 // Process result set 157 while ($data = $stmt->fetch( Doctrine::FETCH_ASSOC)) {157 while ($data = $stmt->fetch(PDO::FETCH_ASSOC)) { 158 158 // Evaluate HYDRATE_SCALAR 159 if ($hydrationMode == Doctrine ::HYDRATE_SCALAR) {159 if ($hydrationMode == Doctrine_Query::HYDRATE_SCALAR) { 160 160 $result[] = $this->_gatherScalarRowData($data, $cache); 161 161 continue; -
trunk/lib/Doctrine/Query.php
r4947 r4964 21 21 */ 22 22 23 #namespace Doctrine::ORM; 24 23 25 /** 24 26 * A Doctrine_Query object represents a DQL query. It is used to query databases for … … 37 39 class Doctrine_Query extends Doctrine_Query_Abstract 38 40 { 41 /* Hydration mode constants */ 42 /** 43 * Hydrates an object graph. This is the default behavior. 44 */ 45 const HYDRATE_OBJECT = 1; 46 /** 47 * Hydrates an array graph. 48 */ 49 const HYDRATE_ARRAY = 2; 50 /** 51 * Hydrates a flat, rectangular result set with scalar values. 52 */ 53 const HYDRATE_SCALAR = 3; 54 /** 55 * Hydrates a single scalar value. 56 */ 57 const HYDRATE_SINGLE_SCALAR = 4; 58 /** 59 * Hydrates nothing. 60 */ 61 const HYDRATE_NONE = 5; 62 39 63 /** 40 64 * @var Doctrine_EntityManager The entity manager used by this query object. … … 55 79 * @var string $_sql Cached SQL query. 56 80 */ 57 protected $_sql = null;81 protected $_sql; 58 82 59 83 -
trunk/lib/Doctrine/Query/ParserRule.php
r4909 r4964 152 152 153 153 //echo $class . "\r\n"; 154 154 //TODO: This expensive check is not necessary. Should be removed at the end. 155 // "new $class" will throw an error anyway if the class is not found. 155 156 if ( ! class_exists($class)) { 156 157 throw new Doctrine_Query_Parser_Exception(