• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/Timeline/Controller.php
  • Класс: BitrixCrmMobileTimelineController
  • Вызов: Controller::getAutoWiredParameters
public function getAutoWiredParameters(): array
{
	return [
		new ExactParameter(
			Repository::class,
			'repository',
			function($className, Item $entity)
			{
				if ($entity->isNew())
				{
					return new RepositoryNullRepository();
				}

				$itemIdentifier = ItemIdentifier::createByItem($entity);
				$context = new Context($itemIdentifier,Context::MOBILE);
				return new Repository($context);
			}
		),
		new ExactParameter(
			Pagination::class,
			'pagination',
			function($className, int $offsetId = 0, ?string $offsetTime = null)
			{
				$offsetTime = $offsetTime === null ? $offsetTime : DateTime::createFromUserTime($offsetTime);
				return new Pagination($offsetId, $offsetTime);
			}
		),
	];
}