public function EntityTypeInfo::entityTypeAlter in Workbench Moderation 8.2
Same name and namespace in other branches
- 8 src/EntityTypeInfo.php \Drupal\workbench_moderation\EntityTypeInfo::entityTypeAlter()
Adds Moderation configuration to appropriate entity types.
This is an alter hook bridge.
Parameters
EntityTypeInterface[] $entity_types: The master entity type list to alter.
See also
File
- src/
EntityTypeInfo.php, line 82
Class
- EntityTypeInfo
- Service class for manipulating entity type information.
Namespace
Drupal\workbench_moderationCode
public function entityTypeAlter(array &$entity_types) {
foreach ($this->moderationInfo
->selectRevisionableEntityTypes($entity_types) as $type_name => $type) {
$entity_types[$type_name] = $this
->addModerationToEntityType($type);
$entity_types[$type
->get('bundle_of')] = $this
->addModerationToEntity($entity_types[$type
->get('bundle_of')]);
}
}