Filter for account type for contacts

This commit is contained in:
Michael 2020-10-09 19:08:50 +00:00
parent ae6b380362
commit 4b9cbac23e
7 changed files with 78 additions and 53 deletions

View file

@ -102,6 +102,29 @@ class User
private static $owner;
/**
* Returns the numeric account type by their string
*
* @param string $accounttype as string constant
* @return void
*/
public static function getAccountTypeByString(string $accounttype)
{
switch ($accounttype) {
case 'person':
return User::ACCOUNT_TYPE_PERSON;
case 'organisation':
return User::ACCOUNT_TYPE_ORGANISATION;
case 'news':
return User::ACCOUNT_TYPE_NEWS;
case 'community':
return User::ACCOUNT_TYPE_COMMUNITY;
default:
return null;
break;
}
}
/**
* Fetch the system account
*