Changeset 5035
- Timestamp:
- 10/02/08 09:13:11 (3 months ago)
- Location:
- branches/1.1
- Files:
-
- 1 added
- 4 modified
-
lib/Doctrine/Record.php (modified) (1 diff)
-
tests/Record/FromArrayTestCase.php (modified) (1 diff)
-
tests/run.php (modified) (1 diff)
-
tests/Ticket/1522TestCase.php (added)
-
UPGRADE_TO_1_1 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1/lib/Doctrine/Record.php
r5034 r5035 1528 1528 } else if ($this->getTable()->hasField($key)) { 1529 1529 $this->set($key, $value); 1530 } else { 1531 $method = 'set' . Doctrine_Inflector::classify($key); 1532 if (method_exists($this, $method)) { 1533 $this->$method($value); 1534 } 1530 1535 } 1531 1536 } -
branches/1.1/tests/Record/FromArrayTestCase.php
r4610 r5035 86 86 $this->assertEqual($user->Group[1]->name, 'Group One'); 87 87 } 88 89 88 } -
branches/1.1/tests/run.php
r5034 r5035 153 153 $tickets->addTestCase(new Doctrine_Ticket_1480_TestCase()); 154 154 $tickets->addTestCase(new Doctrine_Ticket_1507_TestCase()); 155 $tickets->addTestCase(new Doctrine_Ticket_1522_TestCase()); 155 156 $test->addTestCase($tickets); 156 157 -
branches/1.1/UPGRADE_TO_1_1
r5034 r5035 56 56 ) 57 57 */ 58 59 [r5035](http://trac.doctrine-project.org/changeset/5035) - Added ability to use custom setters with fromArray() 60 61 public function setTableDefinition() 62 { 63 $this->hasColumn('password'); 64 } 65 66 public function setEncryptedPassword($password) 67 { 68 return $this->_set('password', md5($password)); 69 } 70 71 $user->fromArray(array('encrypted_password' => 'changeme')); 72 73 Will invoke the custom setter setEncryptedPassword() 58 74 59 75 Default Options