1
0
mirror of synced 2024-12-13 14:56:01 +03:00

Removed getState() method and changed all references to getState() to state()

This commit is contained in:
Jonathan.Wage 2007-08-14 20:23:54 +00:00
parent 5a976de3f4
commit 1b8e9ea091
3 changed files with 3 additions and 14 deletions

View File

@ -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

View File

@ -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} != ?";

View File

@ -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();