function WizardEntityFormController::getFormArgument

Same name and namespace in other branches
  1. 8.x-3.x src/Controller/WizardEntityFormController.php \Drupal\ctools\Controller\WizardEntityFormController::getFormArgument()

Overrides WizardFormController::getFormArgument

File

src/Controller/WizardEntityFormController.php, line 41

Class

WizardEntityFormController
Wrapping controller for wizard forms that serve as the main page body.

Namespace

Drupal\ctools\Controller

Code

protected function getFormArgument(RouteMatchInterface $route_match) {
  $form_arg = $route_match->getRouteObject()
    ->getDefault('_entity_wizard');
  [$entity_type_id, $operation] = explode('.', $form_arg);
  $definition = $this->entityTypeManager
    ->getDefinition($entity_type_id);
  $handlers = $definition->getHandlerClasses();
  if (empty($handlers['wizard'][$operation])) {
    throw new \Exception(sprintf('Unsupported wizard operation %s', $operation));
  }
  return $handlers['wizard'][$operation];
}