support for normal identifiers
This commit is contained in:
parent
ffe169cd03
commit
7a020a524b
@ -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
|
|||||||
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user