- Модуль: dav
- Путь к файлу: ~/bitrix/modules/dav/classes/general/groupdavclientcalendar.php
- Класс: CDavGroupdavClientCalendar
- Вызов: CDavGroupdavClientCalendar::GetCalendarItemsBySyncToken
public function GetCalendarItemsBySyncToken($path, $syncToken = null, $logger = null)
{
$this->Connect();
$prop = [
'getetag',
'getcontenttype',
'resourcetype',
['calendar-data', 'urn:ietf:params:xml:ns:caldav']
];
$result = $this->SyncReport($path, $prop, $syncToken, $logger);
$this->Disconnect();
if (is_null($result) || $this->getError())
{
return null;
}
$xmlDoc = $result->GetBodyXml();
$arItems = [];
$arResponse = $xmlDoc->GetPath("/*/response");
foreach ($arResponse as $response)
{
$arHref = $response->GetPath("/response/href");
if (!empty($arHref))
{
$arItem = [
"href" => urldecode($arHref[0]->GetContent()),
];
$arProps = $response->GetPath("/response/propstat/prop/*");
foreach ($arProps as $prop)
{
$s = $prop->GetContent();
if (is_string($s) || is_numeric($s))
{
$arItem[$prop->GetTag()] = $this->Encode($s);
}
}
$status = $response->GetPath('/response/propstat/status');
if ($status)
{
$arItem['status'] = '200';
}
else
{
$arItem['status'] = '404';
}
$arItems[] = $arItem;
}
}
return $arItems;
}