From f787a29baabb3bbb6e11e897dea36e100c96e79f Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 21 Sep 2007 13:32:03 +0000 Subject: [PATCH] drafting the compound filter --- lib/Doctrine/Record/Filter.php | 10 ++++ lib/Doctrine/Record/Filter/Compound.php | 67 +++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 lib/Doctrine/Record/Filter/Compound.php diff --git a/lib/Doctrine/Record/Filter.php b/lib/Doctrine/Record/Filter.php index 7db586e3c..23ecde382 100644 --- a/lib/Doctrine/Record/Filter.php +++ b/lib/Doctrine/Record/Filter.php @@ -33,6 +33,16 @@ */ abstract class Doctrine_Record_Filter { + protected $_table; + + public function setTable(Doctrine_Table $table) + { + $this->_table = $table; + } + public function getTable() + { + return $this->_table; + } /** * filterSet * defines an implementation for filtering the set() method of Doctrine_Record diff --git a/lib/Doctrine/Record/Filter/Compound.php b/lib/Doctrine/Record/Filter/Compound.php new file mode 100644 index 000000000..5bf7c2bac --- /dev/null +++ b/lib/Doctrine/Record/Filter/Compound.php @@ -0,0 +1,67 @@ +. + */ + +/** + * Doctrine_Record_Filter_Compound + * + * @author Konsta Vesterinen + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @package Doctrine + * @category Object Relational Mapping + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision: 1298 $ + */ +class Doctrine_Record_Filter_Compound extends Doctrine_Record_Filter +{ + protected $_aliases = array(); + + public function __construct(array $aliases) + { + // check that all aliases exist + foreach ($aliases as $alias) { + $this->_table->getRelation($alias); + } + + $this->_aliases = $aliases; + } + + /** + * filterSet + * defines an implementation for filtering the set() method of Doctrine_Record + * + * @param mixed $name name of the property or related component + */ + public function filterSet(Doctrine_Record $record, $name, $value) + { + + } + /** + * filterGet + * defines an implementation for filtering the get() method of Doctrine_Record + * + * @param mixed $name name of the property or related component + */ + public function filterGet(Doctrine_Record $record, $name) + { + + } +}