public function getUserProfile personId if empty personId return FALSE

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
public function getUserProfile($personId)
{
if (empty($personId)) return FALSE;
$res = RestStub::getProfileById($personId);
if ($res['AxnService']['status'] == 'success') {
$return = $res['AxnService']['response'];
//TODO: Get Profile state NAME by ['profile'][state_cd] to ['profile']['state'],
//profile sports (array(Sport1, Sport2)) to ['profile']['sports']
} else return FALSE;
return $return;
}
public function getUserProfileByName($username)
{
if (empty($username)) return FALSE;
$res = RestStub::getPersonIdFromUsername($username);
if ($res['AxnService']['status'] == 'success') {
$personId = $res['AxnService']['response'];
$x = $this->getUserProfile($personId);
//$x = Profile::getUserProfile($personId);
} else return FALSE;
return $return;
}