class WizardEntityFormController in Chaos Tool Suite (ctools) 8.3
Wrapping controller for wizard forms that serve as the main page body.
Hierarchy
- class \Drupal\Core\Controller\FormController uses DependencySerializationTrait
- class \Drupal\ctools\Controller\WizardFormController
- class \Drupal\ctools\Controller\WizardEntityFormController
- class \Drupal\ctools\Controller\WizardFormController
Expanded class hierarchy of WizardEntityFormController
1 string reference to 'WizardEntityFormController'
1 service uses WizardEntityFormController
File
- src/
Controller/ WizardEntityFormController.php, line 14
Namespace
Drupal\ctools\ControllerView source
class WizardEntityFormController extends WizardFormController {
/**
* The entity type manager.
*
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* @param \Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface $argument_resolver
* The argument resolver.
* @param \Drupal\Core\Form\FormBuilderInterface $form_builder
* The form builder.
* @param \Drupal\ctools\Wizard\WizardFactoryInterface $wizard_factory
* The wizard factory.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager.
*/
public function __construct(ArgumentResolverInterface $argument_resolver, FormBuilderInterface $form_builder, WizardFactoryInterface $wizard_factory, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($argument_resolver, $form_builder, $wizard_factory);
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
protected function getFormArgument(RouteMatchInterface $route_match) {
$form_arg = $route_match
->getRouteObject()
->getDefault('_entity_wizard');
list($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];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
FormController:: |
protected | property | The argument resolver. | |
FormController:: |
protected | property | The controller resolver. | |
FormController:: |
protected | property | The form builder. | |
WizardEntityFormController:: |
protected | property | The entity type manager. | |
WizardEntityFormController:: |
protected | function |
Extracts the form argument string from a request. Overrides WizardFormController:: |
|
WizardEntityFormController:: |
public | function |
Overrides WizardFormController:: |
|
WizardFormController:: |
protected | property | The class resolver. | |
WizardFormController:: |
protected | property | The event dispatcher. | |
WizardFormController:: |
protected | property | Tempstore Factory for keeping track of values in each step of the wizard. | |
WizardFormController:: |
public | function |
Invokes the form and returns the result. Overrides FormController:: |
|
WizardFormController:: |
protected | function |
Wizards are not instantiated as simply as forms, so this method is unused. Overrides FormController:: |