Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Sync.php
1<?php
2
4
10use DateTimeInterface;
11
12class Sync extends BaseController
13{
14 public function listAction(array $filter = [], int $limit = 50): ?array
15 {
16 $syncService = new SyncService();
17
18 if (isset($filter['lastDate']))
19 {
20 try
21 {
22 $date = new DateTime($filter['lastDate'], DateTimeInterface::RFC3339);
23 }
24 catch (ObjectException $exception)
25 {
26 $this->addError(new Error($exception->getCode(), $exception->getMessage()));
27
28 return null;
29 }
30
31 return $syncService->getChangesFromDate($date, $limit);
32 }
33
34 $lastId = null;
35
36 if (isset($filter['lastId']))
37 {
38 $lastId = (int)$filter['lastId'];
39 }
40
41 return $syncService->getChangesFromId($lastId, $limit);
42 }
43}
listAction(array $filter=[], int $limit=50)
Definition Sync.php:14