Commit 43811d2c authored by zYne's avatar zYne

updated all the necessary classes to use injectable

parent 13e75b2c
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
* @version $Revision$ * @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/ */
abstract class Doctrine_Access extends Doctrine_Object implements ArrayAccess abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements ArrayAccess
{ {
/** /**
* setArray * setArray
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* @version $Revision$ * @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/ */
abstract class Doctrine_Configurable extends Doctrine_Object abstract class Doctrine_Configurable extends Doctrine_Locator_Injectable
{ {
/** /**
* @var array $attributes an array of containing all attributes * @var array $attributes an array of containing all attributes
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
* @version $Revision$ * @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/ */
class Doctrine_Hydrate extends Doctrine_Object implements Serializable class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializable
{ {
/** /**
* QUERY TYPE CONSTANTS * QUERY TYPE CONSTANTS
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* @version $Revision$ * @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/ */
class Doctrine_Hydrate_Record extends Doctrine_Object class Doctrine_Hydrate_Record extends Doctrine_Locator_Injectable
{ {
protected $_collections = array(); protected $_collections = array();
...@@ -119,4 +119,4 @@ class Doctrine_Hydrate_Record extends Doctrine_Object ...@@ -119,4 +119,4 @@ class Doctrine_Hydrate_Record extends Doctrine_Object
$table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true); $table->setAttribute(Doctrine::ATTR_LOAD_REFERENCES, true);
} }
} }
} }
\ No newline at end of file
...@@ -43,7 +43,10 @@ class Doctrine_Locator_Injectable ...@@ -43,7 +43,10 @@ class Doctrine_Locator_Injectable
* @var array an array of bound resources * @var array an array of bound resources
*/ */
protected $_resources = array(); protected $_resources = array();
/**
* @var Doctrine_Null $null Doctrine_Null object, used for extremely fast null value checking
*/
protected static $_null;
/** /**
* setLocator * setLocator
* this method can be used for setting the locator object locally * this method can be used for setting the locator object locally
...@@ -115,4 +118,25 @@ class Doctrine_Locator_Injectable ...@@ -115,4 +118,25 @@ class Doctrine_Locator_Injectable
return $this; return $this;
} }
/**
* initNullObject
* initializes the null object
*
* @param Doctrine_Null $null
* @return void
*/
public static function initNullObject(Doctrine_Null $null)
{
self::$_null = $null;
}
/**
* getNullObject
* returns the null object associated with this object
*
* @return Doctrine_Null
*/
public static function getNullObject()
{
return self::$_null;
}
} }
...@@ -68,7 +68,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera ...@@ -68,7 +68,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
{ {
$this->_root = dirname(__FILE__); $this->_root = dirname(__FILE__);
Doctrine_Object::initNullObject(new Doctrine_Null); Doctrine_Locator_Injectable::initNullObject(new Doctrine_Null);
} }
/** /**
* setDefaultAttributes * setDefaultAttributes
...@@ -591,4 +591,4 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera ...@@ -591,4 +591,4 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
$r[] = "</pre>"; $r[] = "</pre>";
return implode("\n",$r); return implode("\n",$r);
} }
} }
\ No newline at end of file
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
* @version $Revision$ * @version $Revision$
* @author Konsta Vesterinen <kvesteri@cc.hut.fi> * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/ */
class Doctrine_Validator extends Doctrine_Object class Doctrine_Validator extends Doctrine_Locator_Injectable
{ {
/** /**
* @var array $validators an array of validator objects * @var array $validators an array of validator objects
...@@ -317,4 +317,4 @@ class Doctrine_Validator extends Doctrine_Object ...@@ -317,4 +317,4 @@ class Doctrine_Validator extends Doctrine_Object
return $type; return $type;
} }
}*/ }*/
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment