From 5d3660f285193737856476f17d700ff9ed1468f2 Mon Sep 17 00:00:00 2001 From: zYne Date: Wed, 16 May 2007 22:34:38 +0000 Subject: [PATCH] --- lib/Doctrine/Record/Filter.php | 43 ++++++++++------------------------ 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/lib/Doctrine/Record/Filter.php b/lib/Doctrine/Record/Filter.php index 032dd0994..913b84ad5 100644 --- a/lib/Doctrine/Record/Filter.php +++ b/lib/Doctrine/Record/Filter.php @@ -178,39 +178,20 @@ class Doctrine_Record_Filter */ private function prepareIdentifiers($exists = true) { - switch ($this->_table->getIdentifierType()) { - case Doctrine_Identifier::AUTO_INCREMENT: - case Doctrine_Identifier::SEQUENCE: - $name = $this->_table->getIdentifier(); - - if ($exists) { - if (isset($this->_data[$name]) && $this->_data[$name] !== self::$null) { - $this->_id[$name] = $this->_data[$name]; - } - } - - unset($this->_data[$name]); - - break; - case Doctrine_Identifier::NORMAL: - $this->_id = array(); - $name = $this->_table->getIdentifier(); - - if (isset($this->_data[$name]) && $this->_data[$name] !== self::$null) { + $id = $this->_table->getIdentifier(); + $this->_id = array(); + if (count($id) > 1) { + foreach ($id as $name) { + if ($this->_data[$name] === self::$null) { + $this->_id[$name] = null; + } else { $this->_id[$name] = $this->_data[$name]; } - break; - case Doctrine_Identifier::COMPOSITE: - $names = $this->_table->getIdentifier(); - - foreach ($names as $name) { - if ($this->_data[$name] === self::$null) { - $this->_id[$name] = null; - } else { - $this->_id[$name] = $this->_data[$name]; - } - } - break; + } + } else { + if (isset($this->_data[$id]) && $this->_data[$id] !== self::$null) { + $this->_id[$id] = $this->_data[$id]; + } } } /**