hook_entity_type_build(array &$entity_types)
Add to entity type definitions.
Modules may implement this hook to add information to defined entity types, as defined in \Drupal\Core\Entity\EntityTypeInterface.
To alter existing information or to add information dynamically, use hook_entity_type_alter().
\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_build(array &$entity_types) { /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */ // Add a form for a custom node form without overriding the default // node form. To override the default node form, use hook_entity_type_alter(). $entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm'); }
© 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_build/8.1.x