From 2f70b203e61c215fd71c0117ae1010c7b399384f Mon Sep 17 00:00:00 2001 From: zYne Date: Thu, 20 Sep 2007 20:15:34 +0000 Subject: [PATCH] --- lib/Doctrine/Record.php | 14 +++----------- lib/Doctrine/Record/Filter.php | 8 +++----- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index 8db26885e..d5eb33f4f 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -102,10 +102,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count * @var Doctrine_Validator_ErrorStack error stack object */ protected $_errorStack; - /** - * @var Doctrine_Record_Filter the filter object - */ - protected $_filter; /** * @var array $_references an array containing all the references */ @@ -143,9 +139,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count $exists = false; } - // initialize the filter object - $this->_filter = new Doctrine_Record_Filter($this); - // Check if the current connection has the records table in its registry // If not this record is only used for creating table definition and setting up // relations. @@ -571,7 +564,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count } $this->_table->getRepository()->add($this); - $this->_filter = new Doctrine_Record_Filter($this); $this->cleanData($this->_data); @@ -798,12 +790,12 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count $this->_references[$name] = $rel->fetchRelatedFor($this); } + return $this->_references[$name]; } catch(Doctrine_Table_Exception $e) { + throw new Doctrine_Record_Exception("Unknown property / related component '$name'."); } - - return $this->_references[$name]; } /** * mapValue @@ -1262,7 +1254,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count { if ($id === false) { $this->_id = array(); - $this->_data = $this->_filter->cleanData($this->_data); + $this->_data = $this->cleanData($this->_data); $this->_state = Doctrine_Record::STATE_TCLEAN; $this->_modified = array(); } elseif ($id === true) { diff --git a/lib/Doctrine/Record/Filter.php b/lib/Doctrine/Record/Filter.php index 2275abdbd..578bc432d 100644 --- a/lib/Doctrine/Record/Filter.php +++ b/lib/Doctrine/Record/Filter.php @@ -31,7 +31,7 @@ * @since 1.0 * @version $Revision: 1298 $ */ -class Doctrine_Record_Filter +abstract class Doctrine_Record_Filter { /** * @var Doctrine_Record $_record the record object this filter belongs to @@ -61,14 +61,12 @@ class Doctrine_Record_Filter * * @param mixed $name name of the property or related component */ - abstract public function filterSet($key, $value) - { } + abstract public function filterSet($key, $value); /** * filterGet * defines an implementation for filtering the get() method of Doctrine_Record * * @param mixed $name name of the property or related component */ - abstract public function filterGet($key) - { } + abstract public function filterGet($key); }