ChannelRepository::extractToList

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. ChannelRepository
  4. extractToList
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/messagesender/channel/channelrepository.php
  • Класс: Bitrix\Crm\MessageSender\Channel\ChannelRepository
  • Вызов: ChannelRepository::extractToList
static function extractToList(ItemIdentifier $source): array
{
	$holders = self::getCommunicationsHolders($source);
	if (empty($holders))
	{
		return [];
	}

	$storage = Container::getInstance()->getMultifieldStorage();

	$toListByType = [];
	foreach ($holders as $entityTypeId => $multipleEntityIds)
	{
		$multifieldsForMultipleOwners = $storage->getForMultipleOwners($entityTypeId, $multipleEntityIds);

		foreach ($multifieldsForMultipleOwners as $entityId => $multifields)
		{
			foreach ($multifields as $value)
			{
				$toListByType[$value->getTypeId()][] = new To(
					$source,
					new ItemIdentifier($entityTypeId, $entityId),
					$value,
				);
			}
		}
	}

	return $toListByType;
}

Добавить комментарий