1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
openeventupcounter.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Internals\Counter\Processor\Handler;
4
5use Bitrix\Calendar\Core\Event\Event as CalendarEvent;
6use Bitrix\Calendar\Internals\Counter\CounterDictionary;
7use Bitrix\Calendar\Internals\Counter\CounterService;
8use Bitrix\Calendar\Internals\Counter\CounterTable;
9use Bitrix\Calendar\Internals\Counter\Event\EventDictionary;
10
12{
13 public function __invoke(array $userIds, CalendarEvent $event): void
14 {
15 $rows = [];
16
17 if (empty($userIds))
18 {
19 return;
20 }
21
22 foreach ($userIds as $userId)
23 {
24 if (!$userId || $userId === $event->getCreator()?->getId())
25 {
26 continue;
27 }
28
29 $rows[] = [
30 'PARENT_ID' => $event->getEventOption()->getCategoryId(),
31 'EVENT_ID' => $event->getId(),
32 'USER_ID' => $userId,
34 'VALUE' => 1,
35 ];
36 }
37
38 if (empty($rows))
39 {
40 return;
41 }
42
44 // this will run the Counter\Processor\Total which will update users' counters
45 CounterService::addEvent(EventDictionary::OPEN_EVENT_SCORER_UPDATED, [
46 'user_ids' => $userIds,
47 ]);
48
49 (new OpenEventPushScorer())($userIds, [$event->getEventOption()->getCategoryId()]);
50 }
51}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static addEvent(string $type, array $data)
Определения counterservice.php:40
static addMulti($rows, $ignoreEvents=false)
Определения datamanager.php:1041
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$event
Определения prolog_after.php:141
$rows
Определения options.php:264