Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Pin.php
1<?php
2
4
10
11class Pin extends BaseController
12{
16 public function tailAction(Chat $chat, array $filter = [], array $order = [], int $limit = 50): ?array
17 {
18 $pinFilter = [
19 'LAST_ID' => $filter['lastId'] ?? null,
20 'CHAT_ID' => $chat->getChatId(),
21 'START_ID' => $chat->getStartId() ?: null,
22 ];
23 $pinOrder = [
24 'ID' => $order['id'] ?? 'DESC'
25 ];
26 $pinLimit = $this->getLimit($limit);
27
28 $pins = PinCollection::find($pinFilter, $pinOrder, $pinLimit);
29
30 return (new RestAdapter($pins))->toRestFormat();
31 }
32
33 public function countAction(Chat $chat): ?array
34 {
35 return [
36 'counter' => (new PinService())->getCount($chat->getChatId(), $chat->getStartId())
37 ];
38 }
39}
tailAction(Chat $chat, array $filter=[], array $order=[], int $limit=50)
Definition Pin.php:16