1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Sync.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Controller;
4
5use Bitrix\Im\V2\Error;
6use Bitrix\Im\V2\Sync\SyncService;
7use Bitrix\Main\ObjectException;
8use Bitrix\Main\Type\DateTime;
9use DateTimeInterface;
10
11class Sync extends BaseController
12{
13 private const DATE_FORMAT = DateTimeInterface::RFC3339;
14
15 public function listAction(array $filter = [], int $limit = 50): ?array
16 {
17 $syncService = new SyncService();
18
19 if (isset($filter['lastDate']))
20 {
21 try
22 {
23 $date = new DateTime($filter['lastDate'], self::DATE_FORMAT);
24 }
25 catch (ObjectException $exception)
26 {
27 $this->addError(new Error($exception->getCode(), $exception->getMessage()));
28
29 return null;
30 }
31 }
32 else
33 {
34 $date = new DateTime(null, self::DATE_FORMAT);
35 }
36
37 return $syncService->getChangesFromDate($date, $limit);
38 }
39}
listAction(array $filter=[], int $limit=50)
Определения Sync.php:15
Определения error.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$filter
Определения iblock_catalog_list.php:54
Определения ChatsSync.php:3