- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/lib/sync/managers/synchronization.php
- Класс: BitrixCalendarSyncManagersSynchronization
- Вызов: Synchronization::execActionSection
private function execActionSection(
string $method,
Section $section,
Context $context
): Result
{
$mainResult = new Result();
$resultData = [];
$pushManager = new PushManager();
$push = null;
/** @var FactoryInterface $factory */
foreach ($this->factories as $factory)
{
if ($this->checkExclude($factory, $context, $method))
{
continue;
}
if ($factory->getConnection()->getId())
{
$push = $pushManager->getPush(PushManager::TYPE_CONNECTION, $factory->getConnection()->getId());
$pushManager->setBlockPush($push);
}
try
{
$vendorSync = $this->getVendorSynchronization($factory);
$sectionContext = $this->prepareSectionContext($section, $context, $factory);
$vendorResult = $vendorSync->$method($section, $sectionContext);
$resultData[$this->getVendorCode($factory)] = $vendorResult;
if (!$vendorResult->isSuccess())
{
$mainResult->addErrors($vendorResult->getErrors());
}
}
catch (RemoteAccountException $e)
{
$mainResult->addError(new Error($e->getMessage(), $e->getCode()));
}
finally
{
$pushManager->setUnblockPush($push);
}
}
return $mainResult->setData($resultData);
}