From 1b8e9ea0911d9ab997df906847fec847331563d1 Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Tue, 14 Aug 2007 20:23:54 +0000 Subject: [PATCH] Removed getState() method and changed all references to getState() to state() --- lib/Doctrine/Record.php | 11 ----------- lib/Doctrine/Validator/Unique.php | 2 +- tests/Record/HookTestCase.php | 4 ++-- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index 89c6d3dff..27b40a208 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -578,17 +578,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count $this->postUnserialize($event); } - /** - * getState - * returns the current state of the object - * - * @see Doctrine_Record::STATE_* constants - * @return integer - */ - public function getState() - { - return $this->_state; - } /** * state * returns / assigns the state of this record diff --git a/lib/Doctrine/Validator/Unique.php b/lib/Doctrine/Validator/Unique.php index e5dbf992b..d4135b127 100644 --- a/lib/Doctrine/Validator/Unique.php +++ b/lib/Doctrine/Validator/Unique.php @@ -55,7 +55,7 @@ class Doctrine_Validator_Unique // If the record is not new we need to add primary key checks because its ok if the // unique value already exists in the database IF the record in the database is the same // as the one that is validated here. - $state = $record->getState(); + $state = $record->state(); if (! ($state == Doctrine_Record::STATE_TDIRTY || $state == Doctrine_Record::STATE_TCLEAN)) { foreach ($table->getPrimaryKeys() as $pk) { $sql .= " AND {$pk} != ?"; diff --git a/tests/Record/HookTestCase.php b/tests/Record/HookTestCase.php index 9f9b1d0ff..c79a2299b 100644 --- a/tests/Record/HookTestCase.php +++ b/tests/Record/HookTestCase.php @@ -90,11 +90,11 @@ class Doctrine_Record_Hook_TestCase extends Doctrine_UnitTestCase $this->assertEqual($r->something, 'something'); $this->assertEqual($r->deleted, null); - $this->assertEqual($r->getState(), Doctrine_Record::STATE_CLEAN); + $this->assertEqual($r->state(), Doctrine_Record::STATE_CLEAN); try{ $r->delete(); - $this->assertEqual($r->getState(), Doctrine_Record::STATE_CLEAN); + $this->assertEqual($r->state(), Doctrine_Record::STATE_CLEAN); $this->assertEqual($r->deleted, true); }catch(Doctrine_Exception $e){ $this->fail();