1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
employeehelper.php
См. документацию.
1<?php
2
3namespace Bitrix\Socialnetwork\Integration\HumanResources;
4
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;
15
17{
26 public static function employeesToDepartment(EO_User_Collection $usersCollection): array
27 {
28 if (!Loader::includeModule('humanresources'))
29 {
30 return [];
31 }
32 $employeesNodeMap = [];
33
34 foreach ($usersCollection as $user)
35 {
36 $nodeMember = Container::getNodeMemberRepository()
37 ->findFirstByEntityIdAndEntityTypeAndNodeTypeAndActive(
38 $user->getId(),
39 MemberEntityType::USER,
40 NodeEntityType::DEPARTMENT,
41 );
42
43 if ($nodeMember)
44 {
45 $employeesNodeMap[$nodeMember->entityId] = $nodeMember->nodeId;
46 }
47 }
48
49 return $employeesNodeMap;
50 }
51}
static employeesToDepartment(EO_User_Collection $usersCollection)
Определения employeehelper.php:26
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$user
Определения mysql_to_pgsql.php:33