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; }
protected function _setPassword($value) { $hasher = new DefaultPasswordHasher(); return $hasher->hash($value); }