コード例 #1
0
ファイル: Player.php プロジェクト: AndriyK/team
 /**
  * Generates password hash and security tokens
  * @param bool $insert
  * @return bool
  * @throws \yii\base\Exception
  * @throws \yii\base\InvalidConfigException
  */
 public function beforeSave($insert)
 {
     $this->isNewRecord = $this->getIsNewRecord();
     if ($this->isNewRecord) {
         $this->password = Yii::$app->security->generatePasswordHash($this->password);
     }
     return parent::beforeSave($insert);
 }
コード例 #2
0
ファイル: Game.php プロジェクト: AndriyK/team
 /**
  * @inheritdoc
  */
 public function beforeSave($insert)
 {
     $this->isNewRecord = $this->getIsNewRecord();
     return parent::beforeSave($insert);
 }