Commit 7a020a52 authored by doctrine's avatar doctrine

support for normal identifiers

parent ffe169cd
...@@ -292,7 +292,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite ...@@ -292,7 +292,6 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
switch($this->table->getIdentifierType()): switch($this->table->getIdentifierType()):
case Doctrine_Identifier::AUTO_INCREMENT: case Doctrine_Identifier::AUTO_INCREMENT:
case Doctrine_Identifier::SEQUENCE: case Doctrine_Identifier::SEQUENCE:
$name = $this->table->getIdentifier(); $name = $this->table->getIdentifier();
if($exists) { if($exists) {
...@@ -303,9 +302,16 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite ...@@ -303,9 +302,16 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
unset($this->data[$name]); unset($this->data[$name]);
break; 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: case Doctrine_Identifier::COMPOSITE:
$names = $this->table->getIdentifier(); $names = $this->table->getIdentifier();
$this->id = array();
foreach($names as $name) { foreach($names as $name) {
if($this->data[$name] === self::$null) if($this->data[$name] === self::$null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment