Changeset 4938 for trunk/lib/Doctrine

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

further cleanup in configuration

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine/Common/Configuration.php

    r4937 r4938  
    2929 *  
    3030 * INTERNAL: When adding a new configuration option just write a getter/setter 
    31  * combination and add the option to the _attributes array with a proper default value. 
     31 * pair and add the option to the _attributes array with a proper default value. 
    3232 * 
    3333 * @author Roman Borschel <roman@code-factory.org> 
     
    3636class Doctrine_Common_Configuration 
    3737{ 
    38     private $_nullObject; 
    39      
    4038    /** 
    4139     * The attributes that are contained in the configuration. 
    42      * Values are default values. PHP null is replaced by a reference to the Null 
    43      * object on instantiation in order to use isset() instead of array_key_exists(). 
     40     * Values are default values. 
    4441     * 
    4542     * @var array 
     
    5956     */ 
    6057    public function __construct() 
    61     { 
    62         $this->_nullObject = new stdClass(); 
    63         $this->_initAttributes(); 
    64     } 
    65      
    66     /** 
    67      * Initializes the attributes. 
    68      * Changes null default values to references to the Null object to allow 
    69      * fast isset() checks instead of array_key_exists(). 
    70      *  
    71      * @return void 
    72      */ 
    73     private function _initAttributes() 
    74     { 
    75         foreach ($this->_attributes as $key => $value) { 
    76             if ($value === null) { 
    77                 $this->_attributes[$key] = $this->_nullObject; 
    78             } 
    79         } 
    80     } 
    81      
    82     /** 
    83      * Checks whether the configuration contains/supports an attribute. 
    84      * 
    85      * @param string $name 
    86      * @return boolean 
    87      */ 
    88     public function has($name) 
    89     { 
    90         return isset($this->_attributes[$name]); 
    91     } 
     58    {} 
    9259     
    9360    public function getQuoteIdentifiers()