From 7a020a524bc1a2c9667d9b8baa63761f8e617eb5 Mon Sep 17 00:00:00 2001 From: doctrine Date: Thu, 27 Jul 2006 18:31:18 +0000 Subject: [PATCH] support for normal identifiers --- Doctrine/Record.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Doctrine/Record.php b/Doctrine/Record.php index 342aeb4e3..8e38bc914 100644 --- a/Doctrine/Record.php +++ b/Doctrine/Record.php @@ -292,7 +292,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite switch($this->table->getIdentifierType()): case Doctrine_Identifier::AUTO_INCREMENT: case Doctrine_Identifier::SEQUENCE: - $name = $this->table->getIdentifier(); if($exists) { @@ -303,9 +302,16 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite 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) + $this->id[$name] = $this->data[$name]; + break; case Doctrine_Identifier::COMPOSITE: $names = $this->table->getIdentifier(); - $this->id = array(); + foreach($names as $name) { if($this->data[$name] === self::$null)