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