1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
openevent.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Internals\Counter\Provider;
4
5use Bitrix\Calendar\Internals\Counter\CounterDictionary;
6use Bitrix\Calendar\Internals\Counter\State\State;
7
8class OpenEvent implements Base
9{
10 private int $entityId;
11 private State $state;
12
13 public function __construct(State $state, int $entityId)
14 {
15 $this->entityId = $entityId;
16 $this->state = $state;
17 }
18
19 public function getValue(): int
20 {
21 // get by selected category
22 if ($this->entityId)
23 {
24 return $this->state->get(CounterDictionary::META_PROP_OPEN_EVENTS)['category'][$this->entityId] ?? 0;
25 }
26
27 // get sum of all categories
28 return $this->state->get(CounterDictionary::META_PROP_OPEN_EVENTS)['total'] ?? 0;
29 }
30}
__construct(State $state, int $entityId)
Определения openevent.php:13
$entityId
Определения payment.php:4