- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/pushmanager.php
- Класс: BitrixCalendarSyncManagersPushManager
- Вызов: PushManager::handlePush
public function handlePush(string $channel, string $resourceId, bool $forceUnprocessedPush = false): Result
{
$result = new Result();
$row = PushTable::query()
->setSelect(['*'])
->addFilter('=CHANNEL_ID', $channel)
->addFilter('=RESOURCE_ID', $resourceId)
->exec()->fetchObject()
;
if ($row)
{
$push = (new BuilderPushFromDM($row))->build();
if ($push->isBlocked())
{
$this->setUnprocessedPush($push);
return new Result();
}
if (!$forceUnprocessedPush && $push->isUnprocessed())
{
return new Result();
}
try
{
$this->blockPush($push);
if ($push->getEntityType() === self::TYPE_SECTION_CONNECTION)
{
$this->syncSection($push);
}
elseif ($push->getEntityType() === self::TYPE_CONNECTION)
{
$this->syncConnection($push);
}
if ($this->getPushState($push->getEntityType(), $push->getEntityId())
=== Dictionary::PUSH_STATUS_PROCESS['unprocessed'])
{
$this->handlePush($channel, $resourceId, true);
}
}
catch(Throwable $e)
{
}
finally
{
$this->setUnblockPush($push);
}
}
return $result;
}