From a4ae926a85b0fd105bfee03bce05c585bb66cc72 Mon Sep 17 00:00:00 2001 From: zYne Date: Mon, 22 Oct 2007 17:33:47 +0000 Subject: [PATCH] added isIdentifier() --- lib/Doctrine/Table.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/Table.php b/lib/Doctrine/Table.php index 98e7b3293..2749f8e0a 100644 --- a/lib/Doctrine/Table.php +++ b/lib/Doctrine/Table.php @@ -334,7 +334,13 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable } } - public function getMethodOwner($method) + public function isIdentifier($identifier) + { + return ($identifier === $this->_identifier || + in_array($identifier, (array) $this->_identifier)); + } + + public function getMethodOwner($method) { return (isset($this->_invokedMethods[$method])) ? $this->_invokedMethods[$method] : false; @@ -1372,7 +1378,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable { if ($value === self::$_null) { return self::$_null; - } else if ($value === null) { + } elseif ($value === null) { return null; } else { $type = $this->getTypeOf($field); @@ -1654,4 +1660,4 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable } } } -} \ No newline at end of file +}