3namespace Bitrix\Socialnetwork\Integration\HumanResources;
5use Bitrix\HumanResources\Exception\WrongStructureItemException;
6use Bitrix\HumanResources\Service\Container;
7use Bitrix\HumanResources\Type\MemberEntityType;
8use Bitrix\HumanResources\Type\NodeEntityType;
9use Bitrix\Main\ArgumentException;
10use Bitrix\Main\EO_User_Collection;
11use Bitrix\Main\Loader;
12use Bitrix\Main\LoaderException;
13use Bitrix\Main\ObjectPropertyException;
14use Bitrix\Main\SystemException;
28 if (!Loader::includeModule(
'humanresources'))
32 $employeesNodeMap = [];
34 foreach ($usersCollection as
$user)
36 $nodeMember = Container::getNodeMemberRepository()
37 ->findFirstByEntityIdAndEntityTypeAndNodeTypeAndActive(
39 MemberEntityType::USER,
40 NodeEntityType::DEPARTMENT,
45 $employeesNodeMap[$nodeMember->entityId] = $nodeMember->nodeId;
49 return $employeesNodeMap;
static employeesToDepartment(EO_User_Collection $usersCollection)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)