public static function OverrideHelper::entityForm in Lightning Core 8
Same name and namespace in other branches
- 8.5 src/OverrideHelper.php \Drupal\lightning_core\OverrideHelper::entityForm()
- 8.2 src/OverrideHelper.php \Drupal\lightning_core\OverrideHelper::entityForm()
- 8.3 src/OverrideHelper.php \Drupal\lightning_core\OverrideHelper::entityForm()
- 8.4 src/OverrideHelper.php \Drupal\lightning_core\OverrideHelper::entityForm()
Overrides the class used for an entity form.
The replacement class is only used if its immediate parent is the form class used for the specified operation.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.
string $replacement_class: The class to use.
string $operation: (optional) The entity operation.
1 call to OverrideHelper::entityForm()
- lightning_core_entity_type_alter in ./
lightning_core.module - Implements hook_entity_type_alter().
File
- src/
OverrideHelper.php, line 59
Class
- OverrideHelper
- Helps tweak and override implementations of various things.
Namespace
Drupal\lightning_coreCode
public static function entityForm(EntityTypeInterface $entity_type, $replacement_class, $operation = 'default') {
if (get_parent_class($replacement_class) == $entity_type
->getFormClass($operation)) {
$entity_type
->setFormClass($operation, $replacement_class);
}
}