/** * Search for user with name equal to or containing the term provided. * @param String $searchTerm */ public function searchUser($searchTerm) { $this->searchModel->searchUser($searchTerm); if ($this->searchModel->foundMatch()) { $this->profileView->setUser($this->searchModel->getSearchResult()); } else { $this->searchView->setResult($this->searchModel->getSearchResult()); } }
/** * Calls \view\UserProfileView to set correct user profile to be rendered. */ public function setUserProfile($user) { $this->userProfileView->setUser($user); }