+ private static function getAccountType($apcontact)
+ {
+ $accounttype = -1;
+
+ switch($apcontact['type']) {
+ case 'Person':
+ $accounttype = User::ACCOUNT_TYPE_PERSON;
+ break;
+ case 'Organization':
+ $accounttype = User::ACCOUNT_TYPE_ORGANISATION;
+ break;
+ case 'Service':
+ $accounttype = User::ACCOUNT_TYPE_NEWS;
+ break;
+ case 'Group':
+ $accounttype = User::ACCOUNT_TYPE_COMMUNITY;
+ break;
+ case 'Application':
+ $accounttype = User::ACCOUNT_TYPE_RELAY;
+ break;
+ }
+
+ return $accounttype;
+ }
+