. */ /** * Production variables holder * * @author Guilherme Blanco * @author Janne Vanhala * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.phpdoctrine.org * @since 2.0 * @version $Revision$ */ class Doctrine_ORM_Query_ParserDataHolder { protected static $_instance; protected $_data; protected function __construct() { $this->free(); } public static function create() { if ( ! isset(self::$_instance)) { self::$_instance = new self; } return self::$_instance; } public function free() { $this->_data = array(); } public function set($offset, $value) { $this->_data[$offset] = $value; } public function get($offset) { return isset($this->_data[$offset]) ? $this->_data[$offset] : null; } public function has($offset) { return isset($this->_data[$offset]); } public function remove($offset) { if ($this->has($offset)) { $this->_data[$offset] = null; unset($this->_data[$offset]); } } }