public function beforeSave() { if (!empty($this->data['senha'])) { $cript = new \Core\Security(); $this->data['senha'] = $cript->crypt($this->data['senha']); } else { unset($this->data['senha']); } //$this->data['username'] = $this->removeMask($this->data['username']); }
public function beforeSave() { if (!empty($this->data['senha'])) { $cript = new \Core\Security(); $this->data['senha'] = $cript->crypt($this->data['senha']); } else { unset($this->data['senha']); } $this->data['cpf'] = str_replace(['.', '-'], '', $this->data['cpf']); $this->data['email'] = strtolower($this->data['email']); }