• Модуль: rpa
  • Путь к файлу: ~/bitrix/modules/rpa/lib/controller/base.php
  • Класс: BitrixRpaControllerBase
  • Вызов: Base::getAutoWiredParameters
public function getAutoWiredParameters(): array
{
	return [
		new ExactParameter(
			BitrixRpaModelType::class,
			'type',
			static function ($className, $typeId) {
				return TypeTable::getById($typeId)->fetchObject();
			}
		),
		new ExactParameter(
			BitrixRpaModelStage::class,
			'stage',
			static function($className, $id)
			{
				$stageData = StageTable::getList([
					'select' => ['TYPE_ID'],
					'filter' => [
						'=ID' => $id,
					]
				])->fetch();
				if ($stageData && $stageData['TYPE_ID'] > 0)
				{
					$type = Driver::getInstance()->getType($stageData['TYPE_ID']);
					if ($type)
					{
						return $type->getStage($id);
					}
				}

				return null;
			}
		),
		new ExactParameter(
			BitrixRpaModelTimeline::class,
			'timeline',
			static function ($className, $id) {
				return TimelineTable::getById($id)->fetchObject();
			}
		),
	];
}