1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
LastActivityTrigger.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Collab\Activity;
6
7use Bitrix\Main\DI\ServiceLocator;
8use Bitrix\Socialnetwork\Collab\Collab;
9use Bitrix\Socialnetwork\Collab\Control\Activity\Command\DeleteLastActivityCommand;
10use Bitrix\Socialnetwork\Collab\Control\Activity\Command\SetLastActivityCommand;
11use Bitrix\Socialnetwork\Collab\Registry\CollabRegistry;
12
14{
15 public static function execute(int $userId, int $collabId): void
16 {
17 if ($userId <= 0)
18 {
19 return;
20 }
21
22 $collab = CollabRegistry::getInstance()->get($collabId);
23 if ($collab === null)
24 {
25 return;
26 }
27
28 $command = (new SetLastActivityCommand())
29 ->setUserId($userId)
30 ->setCollabId($collabId);
31
32 $service = ServiceLocator::getInstance()->get('socialnetwork.collab.activity.service');
33
34 $service->set($command);
35 }
36
37 public static function remove(int $collabId = 0, array $userIds = []): void
38 {
39 $command = new DeleteLastActivityCommand();
40 if ($collabId > 0)
41 {
42 $command->setCollabId($collabId);
43 }
44
45 if (!empty($userIds))
46 {
47 $command->setUserIds($userIds);
48 }
49
50 $service = ServiceLocator::getInstance()->get('socialnetwork.collab.activity.service');
51
52 $service->delete($command);
53 }
54}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static execute(int $userId, int $collabId)
Определения LastActivityTrigger.php:15
</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