public function localGenreModel() { switch ($this->getGenre()) { case USER_GENRE::STUDENT: return StudentHandler::loadModelByUserID($this->getId()); break; case USER_GENRE::PERSON: return PersonHandler::loadModelByUserID($this->getId()); break; case USER_GENRE::COMPANY: return CompanyHandler::loadModelByUserID($this->getId()); break; default: # code... break; } return null; }
protected static function detail() { $p_where = array(); $p_where['userID'] = W2HttpRequest::getRequestInt('userid', null, false, false); if ($p_where['userID'] > 0) { $tmpModel = CompanyHandler::loadModelByUserID($p_where['userID']); } $p_countThis = null; $tmpResult = static::loadList($p_where, $p_order = 'id', $p_pageIndex = 1, $p_pageSize = 1, $p_countThis, $isDetail = true); if (is_array($tmpResult) && array_key_exists('errorCode', $tmpResult)) { return $tmpResult; } return Utility::getArrayForResults(RUNTIME_CODE_OK, '', $tmpResult); }