public function beforeSave($options = array())
 {
     if (isset($this->data[$this->alias]['password'])) {
         $passwordHasher = new DefaultPasswordHasher();
         $this->data[$this->alias]['encrypted_password'] = $passwordHasher->hash($this->data[$this->alias]['password']);
     }
     $this->data[$this->alias]['group_id'] = $this->defaultGroupId;
     return true;
 }
Example #2
0
 protected function _setPassword($value)
 {
     $hasher = new DefaultPasswordHasher();
     return $hasher->hash($value);
 }