/** * Finds user by [[username]] * * @return Employee|null */ protected function getEmployee() { if ($this->_user === null) { $this->_user = Employee::findByUsername($this->username); } return $this->_user; }