19 $entityClass = $this->getEntityClassByType($type);
25 $entity =
new $entityClass($id);
30 private function getEntityClassByType(
string $type): ?string
34 case (AccessCode::TYPE_OTHER):
35 return Entity\Other::class;
36 case (AccessCode::TYPE_USER):
37 return Entity\User::class;
38 case (AccessCode::TYPE_SOCNETGROUP):
39 return \Bitrix\Main\Loader::includeModule(
'socialnetwork') ? Entity\SocnetGroup::class :
null;
40 case (AccessCode::TYPE_GROUP):
41 return Entity\Group::class;
42 case (AccessCode::TYPE_DEPARTMENT):
43 return Entity\Department::class;
44 case (AccessCode::TYPE_ACCESS_DIRECTOR):
45 return Entity\AccessDirector::class;
46 case (AccessCode::TYPE_ACCESS_EMPLOYEE):
47 return Entity\UserAll::class;
getEntity(string $type, int $id)