• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Service/EventHistory/TrackedObject.php
  • Класс: Bitrix\Crm\Service\EventHistory\TrackedObject
  • Вызов: TrackedObject::normalizeCollection
protected function normalizeCollection($collection): array
{
	if (is_null($collection))
	{
		return [];
	}

	if (!$this->isCollection($collection))
	{
		throw new ArgumentException(
			'Collection should be an instance of '.Collection::class.' or array of '.EntityObject::class.' ('.Item::class.')'
		);
	}

	if ($collection instanceof Collection)
	{
		$collection = $collection->getAll();
	}

	return $collection;
}