Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function beforeSave($insert)
 {
     if (parent::beforeSave($insert)) {
         if ($this->isNewRecord || !$this->isNewRecord && $this->password) {
             $this->setPassword($this->password);
             $this->generateAuthKey();
             $this->generatePasswordResetToken();
         }
         return true;
     }
     return false;
 }