Hi everyone. I'm struggling with a problem with setter on my model.
Lets say I have a model User
class User extends \Phalcon\Mvc\Model
{
public function setPassword()
{
$this->password = md5($password);
}
}
when I'm trying to set a password from controller to a new user
public function newAction()
{
$user = new User();
$user->setPassword($password);
$user->save();
}
setPassword gets called twice. In effect saved password is a hash of a hash of password string.
Is this a known issue?
Sometimes I might need to assign a value to the field without setter (although setter exists). $user->password seem to call setPassword anyway.