diff --git a/lib/Doctrine/Connection/UnitOfWork.php b/lib/Doctrine/Connection/UnitOfWork.php index bab89e0ec..3ca720fb1 100644 --- a/lib/Doctrine/Connection/UnitOfWork.php +++ b/lib/Doctrine/Connection/UnitOfWork.php @@ -411,7 +411,7 @@ class Doctrine_Connection_UnitOfWork extends Doctrine_Connection_Module $this->conn->insert($table->getTableName(), $array); if (empty($seq) && count($keys) == 1 && $keys[0] == $table->getIdentifier() && - $table->getIdentifierType() != Doctrine_Identifier::NORMAL) { + $table->getIdentifierType() != Doctrine::IDENTIFIER_NATURAL) { if (strtolower($this->conn->getName()) == 'pgsql') { $seq = $table->getTableName() . '_' . $keys[0]; diff --git a/lib/Doctrine/Identifier.php b/lib/Doctrine/Identifier.php deleted file mode 100644 index 364fcda8c..000000000 --- a/lib/Doctrine/Identifier.php +++ /dev/null @@ -1,50 +0,0 @@ -. - */ -/** - * Doctrine_Identifier - * - * @author Konsta Vesterinen - * @package Doctrine - * @license http://www.opensource.org/licenses/lgpl-license.php LGPL - * @category Object Relational Mapping - * @link www.phpdoctrine.com - * @since 1.0 - * @version $Revision$ - */ -class Doctrine_Identifier -{ - /** - * constant for auto_increment identifier - */ - const AUTO_INCREMENT = 1; - /** - * constant for sequence identifier - */ - const SEQUENCE = 2; - /** - * constant for normal identifier - */ - const NORMAL = 3; - /** - * constant for composite identifier - */ - const COMPOSITE = 4; -} diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index 7f4486b99..6ff7c293c 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -429,8 +429,8 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite private function prepareIdentifiers($exists = true) { switch ($this->_table->getIdentifierType()) { - case Doctrine_Identifier::AUTO_INCREMENT: - case Doctrine_Identifier::SEQUENCE: + case Doctrine::IDENTIFIER_AUTOINC: + case Doctrine::IDENTIFIER_SEQUENCE: $name = $this->_table->getIdentifier(); if ($exists) { @@ -442,7 +442,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite unset($this->_data[$name]); break; - case Doctrine_Identifier::NORMAL: + case Doctrine::IDENTIFIER_NATURAL: $this->_id = array(); $name = $this->_table->getIdentifier(); @@ -450,7 +450,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite $this->_id[$name] = $this->_data[$name]; } break; - case Doctrine_Identifier::COMPOSITE: + case Doctrine::IDENTIFIER_COMPOSITE: $names = $this->_table->getIdentifier(); foreach ($names as $name) { diff --git a/lib/Doctrine/Table.php b/lib/Doctrine/Table.php index c661934d4..45f6c8477 100644 --- a/lib/Doctrine/Table.php +++ b/lib/Doctrine/Table.php @@ -241,13 +241,13 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable $this->primaryKeys[] = 'id'; $this->identifier = 'id'; - $this->identifierType = Doctrine_Identifier::AUTO_INCREMENT; + $this->identifierType = Doctrine::IDENTIFIER_AUTOINC; $this->columnCount++; break; default: if (count($this->primaryKeys) > 1) { $this->identifier = $this->primaryKeys; - $this->identifierType = Doctrine_Identifier::COMPOSITE; + $this->identifierType = Doctrine::IDENTIFIER_COMPOSITE; } else { foreach ($this->primaryKeys as $pk) { @@ -264,12 +264,12 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable switch (strtolower($e2[0])) { case 'autoincrement': case 'autoinc': - $this->identifierType = Doctrine_Identifier::AUTO_INCREMENT; + $this->identifierType = Doctrine::IDENTIFIER_AUTOINC; $found = true; break; case 'seq': case 'sequence': - $this->identifierType = Doctrine_Identifier::SEQUENCE; + $this->identifierType = Doctrine::IDENTIFIER_SEQUENCE; $found = true; if ($value) { @@ -285,7 +285,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable } } if ( ! isset($this->identifierType)) { - $this->identifierType = Doctrine_Identifier::NORMAL; + $this->identifierType = Doctrine::IDENTIFIER_NATURAL; } $this->identifier = $pk; }