1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
UpdateMemberRoleLogTrait.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Collab\Control\Handler\Trait;
6
7use Bitrix\Main\DI\ServiceLocator;
8use Bitrix\Socialnetwork\Collab\Log\CollabLogEntryCollection;
9use Bitrix\Socialnetwork\Collab\Log\Entry\ChangeCollabMemberRoleLogEntry;
10use Bitrix\Socialnetwork\Control\Handler\HandlerResult;
11
12trait UpdateMemberRoleLogTrait
13{
14 private function writeMemberRoleUpdateLog(array $userIds, int $collabId, int $initiatorId ,string $newRole): HandlerResult
15 {
16 $handlerResult = new HandlerResult();
17
18 if (empty($userIds))
19 {
20 return $handlerResult;
21 }
22
23 $logEntryCollection = new CollabLogEntryCollection();
24
25 foreach ($userIds as $userId)
26 {
27 $logEntry = new ChangeCollabMemberRoleLogEntry(userId: $userId, collabId: $collabId);
28 $logEntry->setNewRole($newRole);
29 $logEntry->setInitiator($initiatorId);
30
31 $logEntryCollection->add($logEntry);
32 }
33
34 $service = ServiceLocator::getInstance()->get('socialnetwork.collab.log.service');
35 $service->saveCollection($logEntryCollection);
36
37 return $handlerResult;
38 }
39}
Определения CollabLogEntryCollection.php:9
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$service
Определения payment.php:18