Skip to content

Instantly share code, notes, and snippets.

@caionorder
Created November 13, 2015 17:16
Show Gist options
  • Save caionorder/a890cdee7b6304fedd4c to your computer and use it in GitHub Desktop.
Save caionorder/a890cdee7b6304fedd4c to your computer and use it in GitHub Desktop.
<?PHP
class User extends AppModel{
public $name = 'User';
public function beforeSave($options = array()) {
if (isset($this->data[$this->alias]['password'])) {
$this->data[$this->alias]['password'] = AuthComponent::password($this->data[$this->alias]['password']);
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment