#1658: feature : use accessor callback when setting values with
Doctrine_Record::fromArray()
-----------------------------------+----------------------------------------
 Reporter:  nORKy                  |       Owner:  romanb 
     Type:  enhancement            |      Status:  new    
 Priority:  minor                  |   Milestone:  Unknown
Component:  Record                 |     Version:  1.0-DEV
 Keywords:                         |    Has_test:  0      
 Mystatus:  Pending Core Response  |   Has_patch:  0      
-----------------------------------+----------------------------------------
 Ex:
 I wrote an accessor in my !User !Record class

 {{{
 public function setPassword($val)
 {
   $res = $this->_set('passwd_hash', md5(sha1($val)));
   $res2 = $this->_set('passwd_tdes', $this->getTable()->crypt_tdes($pwd));
 }
 }}}

 I have no password fiel, but I have a passwd_hash and a passwd_tdes fields

 When I do this :
 {{{
 $user = New User();
 ...
 $user->password = 'mypassword';
 $user->save();
 }}}
 no problem, passwd_hash and passwd are set.

 But if I do this :
 {{{
 $from = array('password' => 'mypassword');
 $user = New User()
 $user->fromArray($form);
 $user->save();
 }}}
 passwd_hash and passwd_tdes are no set. The accessor setPassword is not
 call.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1658>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to