Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
User.php
1<?php
2
4
6
7class User extends BaseController
8{
12 public function listAction(\Bitrix\Im\V2\Chat $chat, array $order = [], int $limit = self::DEFAULT_LIMIT): ?array
13 {
14 $relationOrder = $this->prepareRelationOrder($order);
15 $limit = $this->getLimit($limit);
16
17 return $this->toRestFormat($chat->getRelations(['ORDER' => $relationOrder, 'LIMIT' => $limit])->getUsers());
18 }
19
20 private function prepareRelationOrder(array $order): array
21 {
22 if (isset($order['id']))
23 {
24 return ['ID' => strtoupper($order['id'])];
25 }
26 if (isset($order['lastSendMessageId']))
27 {
28 return ['LAST_SEND_MESSAGE_ID' => strtoupper($order['lastSendMessageId'])];
29 }
30 if (isset($order['userId']))
31 {
32 return ['USER_ID' => strtoupper($order['USER_ID'])];
33 }
34
35 return [];
36 }
37}
toRestFormat(RestConvertible ... $entities)
listAction(\Bitrix\Im\V2\Chat $chat, array $order=[], int $limit=self::DEFAULT_LIMIT)
Definition User.php:12