• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/access/rule/factory/rulecontrollerfactory.php
  • Класс: BitrixMainAccessRuleFactoryRuleControllerFactory
  • Вызов: RuleControllerFactory::createFromAction
public function createFromAction(string $action, AccessibleController $controller): ?RuleInterface
{
	$className = $this->getClassName($action, $controller);
	if (!$className  || !class_exists($className ))
	{
		return null;
	}

	$ref = new ReflectionClass($className);
	if ($ref->implementsInterface(RuleInterface::class))
	{
		return $ref->newInstance($controller);
	}

	return null;
}