16 private const LIMIT = 50;
22 $offset = (int)(
$option[
'offset'] ?? 0);
26 $userIds = $this->getAffectedUserIds(eventId: $eventId, offset: $offset);
30 return self::FINISH_EXECUTION;
34 ->dropCounter(eventId: $eventId, categoryId: $categoryId, userIds: $userIds)
35 ->setOptions(options:
$option, offset: $offset)
38 return self::CONTINUE_EXECUTION;
41 private function getAffectedUserIds(
int $eventId,
int $offset):
array
48 ->setSelect([
'USER_ID'])
49 ->where(
'EVENT_ID',
'=', $eventId)
50 ->setLimit($this->getLimit())
57 $userIds[] = (int)
$counter[
'USER_ID'];
62 (
new Logger())->log($exception);
68 private function dropCounter(
int $eventId,
int $categoryId,
array $userIds): self
70 (
new Processor\OpenEvent())->dropCounter(userIds: $userIds, eventId: $eventId, categoryId: $categoryId);
75 private function setOptions(
array &
$options,
int $offset): self
77 $options[
'offset'] = $offset + $this->getLimit();
82 private function getLimit(): int
84 $limit = \COption::GetOptionString(
'calendar',
'calendarCounterStepperLimit',
'');