/** * Finds user by [[username]] * * @return User|null */ public function getUser() { if ($this->_user === false) { $this->_user = Operator::findByUsername($this->username); } return $this->_user; }
/** * @return \yii\db\ActiveQuery */ public function getOperator() { return $this->hasOne(\app\models\plrs\Operator::className(), ['id' => 'operator_id']); }