hook_entity_type_alter(array &$entity_types)
Alter the entity type definitions.
Modules may implement this hook to alter the information that defines an entity type. All properties that are available in \Drupal\Core\Entity\Annotation\EntityType and all the ones additionally provided by modules can be altered here.
Do not use this hook to add information to entity types, unless one of the following is true:
Use hook_entity_type_build() instead in all other cases.
\Drupal\Core\Entity\EntityTypeInterface[] $entity_types: An associative array of all entity type definitions, keyed by the entity type name. Passed by reference.
\Drupal\Core\Entity\EntityTypeInterface
function hook_entity_type_alter(array &$entity_types) { /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ // Set the controller class for nodes to an alternate implementation of the // Drupal\Core\Entity\EntityStorageInterface interface. $entity_types['node']->setStorageClass('Drupal\mymodule\MyCustomNodeStorage'); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!entity.api.php/function/hook_entity_type_alter/8.1.x