I have been going straight with this one for a few hours now and I'm
stumped.

Usually from a controller you can just call $this->Model->read, and
then $this->Model->save to update any values changed inbetween.

When I try the same from my Behavior  it fails to update the record.
If I eliminate the read and just make up some valued it will however
write a new record.
When it writes a new record I can see the insert statement in my sql
log.  Otherwise I see no update statement. Further the save operation
returns empty.



Heres what I have

        function banuser(&$model,$userID,$action='unspecific action'){
                //get their info
                $foo=$model->findById($userID);
                $model->data=$model->read(null, $userID);
                debug($model->data); //data was retrieved successfully
                //overwrite their password
                $model->data['User']['password']='ThisUserViolatedTerms'.date
('dmY');
                //save new password effectively blocking them out.
                //also save boolena field to lock
                $model->data['User']['isBanned']=1;

                $pass=$model->save($model->data);
                debug($pass);

Any ideas would be great

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to