Hello,
I have a controller named sales_controller at this controller I got a function in wich I want to:
- update information about the sale -> DONE
- create a new record on other model -> DONE
- update a field on a user record -> PROBLEM
My last attempted to do this was:
App::import('model','User');
$user= $this->Auth->user();
$nr = $this->Auth->user('nr') - 1 ;
if($user->save(array('nr'=>$nr)))
{
$this->Session->setFlash(__('DONE! ', true));
this->redirect(array('action'=>$page,$params));
}
I know that the method $this->Auth->user() returns an array and I read that "save" does not work for arrays...
I was trying to call read function on users, but I still don't know how I should do it.
This must be something simple to do, but I'm still a newbie lol.
So, can anyone help me?
Thanks