Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
EntityFactory.php
1<?php
2
4
6
8{
13 public function createEntities(array $events): array
14 {
15 $messages = new Messages();
16 $chats = new Chats();
17 $pins = new PinMessages();
18
19 foreach ($events as $event)
20 {
21 switch ($event->entityType)
22 {
24 $chats->add($event);
25 break;
27 $messages->add($event);
28 break;
30 $pins->add($event);
31 break;
32 }
33 }
34
35 return [$chats, $messages, $pins];
36 }
37}