Exemple #1
1
 /**
  * @return bool
  */
 public function beforeValidate()
 {
     if ($this->isNewRecord) {
         $this->token = \Yii::$app->security->generateRandomString(32);
     }
     return parent::beforeValidate();
 }