Trac

Changeset 4364

Show
Ignore:
Timestamp:
05/13/08 22:20:34 (2 months ago)
Author:
romanb
Message:

Doctrine_Record renamed. Hydration refactored. Other refactorings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/Doctrine.php

    r4225 r4364  
    290290     * FETCHMODE_RECORD 
    291291     * 
    292      * Specifies that the fetch method shall return Doctrine_Record 
     292     * Specifies that the fetch method shall return Doctrine_Entity 
    293293     * objects as the elements of the result set. 
    294294     * 
     
    472472     */ 
    473473    const HYDRATE_NONE              = 4; 
     474     
     475    /* new hydration modes. move to Query class when it's time. */ 
     476    //const HYDRATE_IDENTITY_OBJECT = 1; // default, auto-adds PKs, produces object graphs 
     477    //const HYDRATE_IDENTITY_ARRAY = 2; // auto-adds PKs, produces array graphs 
     478    //const HYDRATE_SCALAR = 3; // produces flat result list with scalar values 
     479    //const HYDRATE_SINGLE_SCALAR = 4; // produces a single scalar value 
     480    //const HYDRATE_NONE = 5; // produces a result set as it's returned by the db 
     481     
    474482 
    475483    /** 
     
    710718     * Get all the loaded models, you can provide an array of classes or it will use get_declared_classes() 
    711719     * 
    712      * Will filter through an array of classes and return the Doctrine_Records out of them. 
    713      * If you do not specify $classes it will return all of the currently loaded Doctrine_Record
     720     * Will filter through an array of classes and return the Doctrine_Entitys out of them. 
     721     * If you do not specify $classes it will return all of the currently loaded Doctrine_Entity
    714722     * 
    715723     * @return array   $loadedModels 
     
    748756     * isValidModelClass 
    749757     * 
    750      * Checks if what is passed is a valid Doctrine_Record 
     758     * Checks if what is passed is a valid Doctrine_Entity 
    751759     * Will load class in to memory in order to inflect it and find out information about the class 
    752760     * 
     
    756764    public static function isValidModelClass($class) 
    757765    { 
    758         if ($class instanceof Doctrine_Record) { 
     766        if ($class instanceof Doctrine_Entity) { 
    759767            $class = get_class($class); 
    760768        } 
     
    767775            // Skip the following classes 
    768776            // - abstract classes 
    769             // - not a subclass of Doctrine_Record 
     777            // - not a subclass of Doctrine_Entity 
    770778            // - don't have a setTableDefinition method 
    771779            if (!$class->isAbstract() && 
    772                 $class->isSubClassOf('Doctrine_Record')) { 
     780                $class->isSubClassOf('Doctrine_Entity')) { 
    773781 
    774782                return true; 
     
    806814     * generateModelsFromDb 
    807815     * 
    808      * method for importing existing schema to Doctrine_Record classes 
     816     * method for importing existing schema to Doctrine_Entity classes 
    809817     * 
    810818     * @param string $directory Directory to write your models to 
  • trunk/lib/Doctrine/AuditLog.php

    r3882 r4364  
    5656     * Get the version  
    5757     *  
    58      * @param Doctrine_Record $record  
     58     * @param Doctrine_Entity $record  
    5959     * @param mixed $version  
    6060     * @return array An array with version information 
    6161     */ 
    62     public function getVersion(Doctrine_Record $record, $version) 
     62    public function getVersion(Doctrine_Entity $record, $version) 
    6363    {            
    6464        $className = $this->_options['className']; 
  • trunk/lib/Doctrine/Builder/Record.php

    r3882 r4364  
    2323 * Doctrine_Builder_Record 
    2424 * 
    25  * Import builder is responsible of building Doctrine_Record classes 
     25 * Import builder is responsible of building Doctrine_Entity classes 
    2626 * based on a database schema. 
    2727 * 
     
    9494     * @var string 
    9595     */ 
    96     protected $_baseClassName = 'Doctrine_Record'; 
     96    protected $_baseClassName = 'Doctrine_Entity'; 
    9797 
    9898    /** 
     
    271271 
    272272    /* 
    273      * Build the table definition of a Doctrine_Record object 
     273     * Build the table definition of a Doctrine_Entity object 
    274274     * 
    275275     * @param  string $table 
  • trunk/lib/Doctrine/ClassMetadata.php

    r4338 r4364  
    138138     */ 
    139139    protected $_mappedColumns = array(); 
     140     
     141    /** 
     142     * The mapped embedded values (value objects). 
     143     * 
     144     * @var array 
     145     * @TODO Implementation (Value Object support) 
     146     */ 
     147    protected $_mappedEmbeddedValues = array(); 
    140148 
    141149    /** 
     
    172180 
    173181    /** 
    174      * Cached column count, Doctrine_Record uses this column count when 
     182     * Cached column count, Doctrine_Entity uses this column count when 
    175183     * determining its state. 
    176184     * 
     
    15721580     * 
    15731581     * @param array $queryParts         an array of pre-bound query parts 
    1574      * @return Doctrine_Record          this object 
     1582     * @return Doctrine_Entity          this object 
    15751583     */ 
    15761584    public function bindQueryParts(array $queryParts) 
     
    15861594     * @param string $queryPart 
    15871595     * @param mixed $value 
    1588      * @return Doctrine_Record          this object 
     1596     * @return Doctrine_Entity          this object 
    15891597     */ 
    15901598    public function bindQueryPart($queryPart, $value) 
     
    17201728     * @param mixed $constraint     either a SQL constraint portion or an array of CHECK constraints 
    17211729     * @param string $name          optional constraint name 
    1722      * @return Doctrine_Record      this object 
     1730     * @return Doctrine_Entity      this object 
    17231731     * @todo Should be done through $_tableOptions 
    17241732     */ 
     
    18351843     * @param string $options           relation options 
    18361844     * @see Doctrine_Relation::_$definition 
    1837      * @return Doctrine_Record          this object 
     1845     * @return Doctrine_Entity          this object 
    18381846     */ 
    18391847    public function hasOne() 
     
    18511859     * @param string $options           relation options 
    18521860     * @see Doctrine_Relation::_$definition 
    1853      * @return Doctrine_Record          this object 
     1861     * @return Doctrine_Entity          this object 
    18541862     */ 
    18551863    public function hasMany() 
  • trunk/lib/Doctrine/ClassMetadata/Factory.php

    r4119 r4364  
    8080        $loadedParentClass = false; 
    8181        while ($parentClass = get_parent_class($parentClass)) { 
    82             if ($parentClass == 'Doctrine_Record') { 
     82            if ($parentClass == 'Doctrine_Entity') { 
    8383                break; 
    8484            } 
     
    160160        // get parent classes 
    161161        do { 
    162             if ($className === 'Doctrine_Record') { 
     162            if ($className === 'Doctrine_Entity') { 
    163163                break; 
    164164            } else if ($className == $name) { 
  • trunk/lib/Doctrine/Collection.php

    r4338 r4364  
    5959     * This record this collection is attached to, if any. 
    6060     *  
    61      * @var Doctrine_Record 
     61     * @var Doctrine_Entity 
    6262     */ 
    6363    protected $reference; 
     
    309309     * @return void 
    310310     */ 
    311     public function setReference(Doctrine_Record $record, Doctrine_Relation $relation) 
     311    public function setReference(Doctrine_Entity $record, Doctrine_Relation $relation) 
    312312    { 
    313313        $this->reference = $record; 
     
    369369     * 
    370370     */ 
    371     public function search(Doctrine_Record $record) 
     371    public function search(Doctrine_Entity $record) 
    372372    { 
    373373        return array_search($record, $this->data, true); 
     
    389389     * 
    390390     * @param mixed $key                    the key of the element 
    391      * @return Doctrine_Record              return a specified record 
     391     * @return Doctrine_Entity              return a specified record 
    392392     */ 
    393393    public function get($key) 
     
    482482     * set 
    483483     * @param integer $key 
    484      * @param Doctrine_Record $record 
     484     * @param Doctrine_Entity $record 
    485485     * @return void 
    486      * @internal Can't type-hint the second parameter to Doctrine_Record because we need 
     486     * @internal Can't type-hint the second parameter to Doctrine_Entity because we need 
    487487     *           to adhere to the Doctrine_Access::set() signature. 
    488488     */ 
    489489    public function set($key, $record) 
    490490    { 
    491         if ( ! $record instanceOf Doctrine_Record) { 
    492             throw new Doctrine_Collection_Exception('Value variable in set is not an instance of Doctrine_Record'); 
     491        if ( ! $record instanceOf Doctrine_Entity) { 
     492            throw new Doctrine_Collection_Exception('Value variable in set is not an instance of Doctrine_Entity'); 
    493493        } 
    494494 
     
    501501    /** 
    502502     * adds a record to collection 
    503      * @param Doctrine_Record $record              record to be added 
     503     * @param Doctrine_Entity $record              record to be added 
    504504     * @param string $key                          optional key for the record 
    505505     * @return boolean 
     
    507507    public function add($record, $key = null) 
    508508    { 
    509         if ( ! $record instanceof Doctrine_Record) { 
    510             throw new Doctrine_Record_Exception('Value variable in set is not an instance of Doctrine_Record.'); 
     509        if ( ! $record instanceof Doctrine_Entity) { 
     510            throw new Doctrine_Record_Exception('Value variable in set is not an instance of Doctrine_Entity.'); 
    511511        } 
    512512 
  • trunk/lib/Doctrine/Collection/Iterator.php

    r3882 r4364  
    9797     * returns the current record 
    9898     * 
    99      * @return Doctrine_Record 
     99     * @return Doctrine_Entity 
    100100     */ 
    101101    public function current() 
  • trunk/lib/Doctrine/Collection/Offset.php

    r3882 r4364  
    2121/** 
    2222 * Doctrine_Collection_Offset 
    23  * Collection of Doctrine_Record objects. 
     23 * Collection of Doctrine_Entity objects. 
    2424 * 
    2525 * @package     Doctrine 
  • trunk/lib/Doctrine/Connection.php

    r4338 r4364  
    146146     */ 
    147