コード例 #1
0
ファイル: BaseUserModel.php プロジェクト: vistart/yii2-models
 /**
  * Initialize user model.
  * This procedure will append events used for initialization of `status` and
  * `source` attributes.
  * When `$skipInit` is assigned to `false`, the above processes will be skipped.
  * If you want to modify or override this method, you should add `parent::init()`
  * statement at the end of your init() method.
  */
 public function init()
 {
     if (!is_string($this->queryClass)) {
         $this->queryClass = BaseUserQuery::className();
     }
     if ($this->skipInit) {
         return;
     }
     $this->on(self::$eventNewRecordCreated, [$this, 'onInitStatusAttribute']);
     $this->on(self::$eventNewRecordCreated, [$this, 'onInitSourceAttribute']);
     $this->on(self::$eventNewRecordCreated, [$this, 'onInitAuthKey']);
     $this->on(self::$eventNewRecordCreated, [$this, 'onInitAccessToken']);
     $this->on(self::$eventNewRecordCreated, [$this, 'onInitPasswordResetToken']);
     $this->on(self::$eventAfterSetPassword, [$this, 'onAfterSetNewPassword']);
     parent::init();
 }
コード例 #2
0
ファイル: Headword.php プロジェクト: rhoone/yii2-rhoone
 /**
  * @inheritdoc
  * Friendly to IDE.
  * @return HeadwordQuery
  */
 public static function find()
 {
     return parent::find();
 }
コード例 #3
0
 /**
  * Initialize the blameable model.
  * If query class is not specified, [[BaseBlameableQuery]] will be taken.
  */
 public function init()
 {
     if (!is_string($this->queryClass)) {
         $this->queryClass = BaseBlameableQuery::className();
     }
     if ($this->skipInit) {
         return;
     }
     $this->initBlameableEvents();
     parent::init();
 }