function hook_entity_info

Add to entity type definitions.

Modules may implement this hook to add information to defined entity types.

Parameters

array $entity_info: An associative array of all entity type definitions, keyed by the entity type name. Passed by reference.

See also

\Drupal\Core\Entity\Entity

\Drupal\Core\Entity\EntityManager

entity_get_info()

Related topics

3 functions implement hook_entity_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

action_entity_info in drupal/core/modules/action/action.module
Implements hook_entity_info().
field_test_entity_info in drupal/core/modules/field/tests/modules/field_test/field_test.entity.inc
Implements hook_entity_info().
views_ui_entity_info in drupal/core/modules/views_ui/views_ui.module
Implements hook_entity_info().

File

drupal/core/includes/entity.api.php, line 26
Hooks provided the Entity module.

Code

function hook_entity_info(&$entity_info) {

  // Add a form controller for a custom node form without overriding the default
  // node form. To override the default node form, use hook_entity_info_alter()
  // to alter $entity_info['node']['controllers']['form']['default'].
  $entity_info['node']['controllers']['form']['mymodule_foo'] = 'Drupal\\mymodule\\NodeFooFormController';
}