FormOperations
class FormOperations implements ContainerInjectionInterface (View source)
| internal |
Defines a class for reacting to form operations.
Properties
| protected WorkspaceManagerInterface | $workspaceManager | The workspace manager service. |
Methods
Instantiates a new instance of this class.
Alters forms to disallow editing in non-default workspaces.
Adds our validation handler recursively on each element of a form.
Validation handler which sets a validation error for all unsupported forms.
Details
__construct(WorkspaceManagerInterface $workspace_manager)
Constructs a new FormOperations instance.
static
create(ContainerInterface $container)
Instantiates a new instance of this class.
This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.
formAlter(array $form, FormStateInterface $form_state, string $form_id)
Alters forms to disallow editing in non-default workspaces.
protected
addWorkspaceValidation(array $element)
Adds our validation handler recursively on each element of a form.
static
validateDefaultWorkspace(array $form, FormStateInterface $form_state)
Validation handler which sets a validation error for all unsupported forms.