Changeset 4964 for trunk/lib/Doctrine

Show
Ignore:
Timestamp:
09/13/08 13:40:17 (4 months ago)
Author:
romanb
Message:

more cleanups. introducing ClassLoader?.

Location:
trunk/lib/Doctrine
Files:
1 added
2 removed
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine/DBAL/Types/Type.php

    r4911 r4964  
    3030     
    3131    /** 
    32      * Factory method. 
     32     * Factory method to create type instances. 
     33     * Type instances are implemented as flyweights. 
    3334     * 
    3435     * @param string $name The name of the type (as returned by getName()). 
  • trunk/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php

    r4962 r4964  
    5555     * The current hydration mode. 
    5656     */ 
    57     protected $_hydrationMode = Doctrine::HYDRATE_RECORD; 
     57    protected $_hydrationMode = Doctrine_Query::HYDRATE_OBJECT; 
    5858     
    5959    protected $_nullObject; 
  • trunk/lib/Doctrine/ORM/Internal/Hydration/StandardHydrator.php

    r4930 r4964  
    9090        $stmt = $parserResult->getDatabaseStatement(); 
    9191         
    92         if ($hydrationMode == Doctrine::HYDRATE_NONE) { 
     92        if ($hydrationMode == Doctrine_Query::HYDRATE_NONE) { 
    9393            return $stmt->fetchAll(PDO::FETCH_NUM); 
    9494        } 
     
    9797        $this->_queryComponents = $parserResult->getQueryComponents(); 
    9898 
    99         if ($hydrationMode == Doctrine::HYDRATE_ARRAY) { 
     99        if ($hydrationMode == Doctrine_Query::HYDRATE_ARRAY) { 
    100100            $driver = new Doctrine_ORM_Internal_Hydration_ArrayDriver(); 
    101101        } else { 
     
    124124         
    125125        // Holds the resulting hydrated data structure 
    126         if ($parserResult->isMixedQuery() || $hydrationMode == Doctrine::HYDRATE_SCALAR) { 
     126        if ($parserResult->isMixedQuery() || $hydrationMode == Doctrine_Query::HYDRATE_SCALAR) { 
    127127            $result = array(); 
    128128        } else { 
     
    146146        $cache = array(); 
    147147        // Evaluate HYDRATE_SINGLE_SCALAR 
    148         if ($hydrationMode == Doctrine::HYDRATE_SINGLE_SCALAR) { 
     148        if ($hydrationMode == Doctrine_Query::HYDRATE_SINGLE_SCALAR) { 
    149149            $result = $stmt->fetchAll(PDO::FETCH_ASSOC); 
    150150            if (count($result) > 1 || count($result[0]) > 1) { 
     
    155155         
    156156        // Process result set 
    157         while ($data = $stmt->fetch(Doctrine::FETCH_ASSOC)) { 
     157        while ($data = $stmt->fetch(PDO::FETCH_ASSOC)) { 
    158158            // Evaluate HYDRATE_SCALAR 
    159             if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { 
     159            if ($hydrationMode == Doctrine_Query::HYDRATE_SCALAR) { 
    160160                $result[] = $this->_gatherScalarRowData($data, $cache); 
    161161                continue;       
  • trunk/lib/Doctrine/Query.php

    r4947 r4964  
    2121 */ 
    2222 
     23#namespace Doctrine::ORM; 
     24 
    2325/** 
    2426 * A Doctrine_Query object represents a DQL query. It is used to query databases for 
     
    3739class Doctrine_Query extends Doctrine_Query_Abstract 
    3840{ 
     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     
    3963    /** 
    4064     * @var Doctrine_EntityManager The entity manager used by this query object. 
     
    5579     * @var string $_sql Cached SQL query. 
    5680     */ 
    57     protected $_sql = null; 
     81    protected $_sql; 
    5882 
    5983 
  • trunk/lib/Doctrine/Query/ParserRule.php

    r4909 r4964  
    152152 
    153153        //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. 
    155156        if ( ! class_exists($class)) { 
    156157            throw new Doctrine_Query_Parser_Exception(