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