1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
openeventupcounter.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Calendar\Internals\Counter\Processor\Handler;
4
5
use Bitrix\Calendar\Core\Event\Event as CalendarEvent;
6
use Bitrix\Calendar\Internals\Counter\CounterDictionary;
7
use Bitrix\Calendar\Internals\Counter\CounterService;
8
use Bitrix\Calendar\Internals\Counter\CounterTable;
9
use Bitrix\Calendar\Internals\Counter\Event\EventDictionary;
10
11
class
OpenEventUpCounter
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
,
33
'TYPE'
=>
CounterDictionary::SCORER_OPEN_EVENT
,
34
'VALUE'
=> 1,
35
];
36
}
37
38
if
(empty(
$rows
))
39
{
40
return
;
41
}
42
43
CounterTable::addMulti
(
$rows
,
true
);
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
}
$userId
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения
check_mail.php:18
Bitrix\Calendar\Internals\Counter\CounterDictionary\SCORER_OPEN_EVENT
const SCORER_OPEN_EVENT
Определения
counterdictionary.php:24
Bitrix\Calendar\Internals\Counter\CounterService\addEvent
static addEvent(string $type, array $data)
Определения
counterservice.php:40
Bitrix\Calendar\Internals\Counter\Processor\Handler\OpenEventPushScorer
Определения
openeventpushscorer.php:11
Bitrix\Calendar\Internals\Counter\Processor\Handler\OpenEventUpCounter
Определения
openeventupcounter.php:12
Bitrix\Calendar\Internals\Counter\Processor\Handler\OpenEventUpCounter\__invoke
__invoke(array $userIds, CalendarEvent $event)
Определения
openeventupcounter.php:13
Bitrix\Main\ORM\Data\DataManager\addMulti
static addMulti($rows, $ignoreEvents=false)
Определения
datamanager.php:1041
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$event
$event
Определения
prolog_after.php:141
$rows
$rows
Определения
options.php:264
bitrix
modules
calendar
lib
internals
counter
processor
handler
openeventupcounter.php
Создано системой
1.14.0