• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/factories/factoriescollection.php
  • Класс: BitrixCalendarSyncFactoriesFactoriesCollection
  • Вызов: FactoriesCollection::createByEvent
static function createByEvent(Event $event, array $availableService = null)
{
	$collection = [];
	$links = self::getLinks($event->getSection(), $availableService);
	$eventLinks = self::getEventLinksByConnectionId($event);

	/** @var EO_SectionConnection $link */
	while ($link = $links->fetchObject())
	{
		$connection = (new SyncBuildersBuilderConnectionFromDM($link->getConnection()))->build();
		$sectionConnection = (new SyncBuildersBuilderSectionConnectionFromDM($link))->build();

		$context = self::prepareContextForSection($connection, $sectionConnection, $event->getSection());
		$context->add('sync', 'eventConnections', $eventLinks->getItem($connection->getId()));

		$collection[] = FactoryBuilder::create(
			$connection->getVendor()->getCode(),
			$connection,
			$context
		);
	}

	return new self($collection);
}