예제 #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);
 }