3namespace Bitrix\Im\V2\Analytics\Event;
6use Bitrix\Main\Analytics\AnalyticsEvent;
7use Bitrix\Main\Engine\Response\Converter;
18 protected ?
string $p1 =
null;
19 protected ?
string $p2 =
null;
20 protected ?
string $p3 =
null;
21 protected ?
string $p4 =
null;
22 protected ?
string $p5 =
null;
28 $this->
event->setUserId($userId);
37 abstract protected function getTool(): string;
39 abstract protected function getCategory(
string $eventName): string;
48 return (
new Converter(Converter::TO_CAMEL | Converter::LC_FIRST))->process($string);
51 public function send(): void
53 if ($this->type !==
null)
55 $this->
event->setType($this->type);
57 if ($this->section !==
null)
59 $this->
event->setSection($this->section);
61 if ($this->subSection !==
null)
63 $this->
event->setSubSection($this->subSection);
65 if ($this->element !==
null)
67 $this->
event->setElement($this->element);
69 if ($this->status !==
null)
71 $this->
event->setStatus($this->status);
73 if ($this->p1 !==
null)
75 $this->
event->setP1($this->p1);
77 if ($this->p2 !==
null)
79 $this->
event->setP2($this->p2);
81 if ($this->p3 !==
null)
83 $this->
event->setP3($this->p3);
85 if ($this->p4 !==
null)
87 $this->
event->setP4($this->p4);
89 if ($this->p5 !==
null)
91 $this->
event->setP5($this->p5);
99 $this->
event = $event;
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
setSection(?string $section)
getCategory(string $eventName)
setSubSection(?string $subSection)
setEvent(AnalyticsEvent $event)
__construct(string $eventName, Chat $chat, int $userId)
setStatus(?string $status)
setElement(?string $element)
static convertUnderscore(string $string)