/** * 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(); }
/** * @inheritdoc * Friendly to IDE. * @return HeadwordQuery */ public static function find() { return parent::find(); }
/** * 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(); }