You are here

public function GrantedEntityLockingInterface::alterEntityOwnerForm in Commerce License 8.2

Alter a form for an entity owned by the license owner.

This is for use by license type plugins that change something on an entity owned by the license owner when they grant the license.

This allows the license type plugin to disable elements of the form if they are being granted by the license, to prevent them being removed while the license is active. For example, the role plugin locks the role that it grants a user on that user's edit form.

Parameters

array $form: The form array.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

string $form_id: The form ID.

\Drupal\commerce_license\Entity\LicenseInterface $license: The license being considered.

\Drupal\Core\Entity\EntityInterface $form_entity: The entity being edited in the form. It is active, and either owned by the license owner, or is the actual license owner user entity.

See also

commerce_license_form_alter()

1 method overrides GrantedEntityLockingInterface::alterEntityOwnerForm()
Role::alterEntityOwnerForm in src/Plugin/Commerce/LicenseType/Role.php
Alter a form for an entity owned by the license owner.

File

src/Plugin/Commerce/LicenseType/GrantedEntityLockingInterface.php, line 47

Class

GrantedEntityLockingInterface
Interface for license types that lock an aspect of the entities they grant.

Namespace

Drupal\commerce_license\Plugin\Commerce\LicenseType

Code

public function alterEntityOwnerForm(array &$form, FormStateInterface $form_state, $form_id, LicenseInterface $license, EntityInterface $form_entity);