function hook_ENTITY_TYPE_create in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Entity/entity.api.php \hook_ENTITY_TYPE_create()
Acts when creating a new entity of a specific type.
This hook runs after a new entity object has just been instantiated.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The entity object.
See also
Related topics
16 functions implement hook_ENTITY_TYPE_create()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- comment_field_config_create in core/
modules/ comment/ comment.module - Implements hook_ENTITY_TYPE_create() for 'field_config'.
- config_install_dependency_test_config_test_create in core/
modules/ config/ tests/ config_install_dependency_test/ config_install_dependency_test.module - Implements hook_ENTITY_TYPE_create.
- config_test_config_test_create in core/
modules/ config/ tests/ config_test/ config_test.module - Implements hook_ENTITY_TYPE_create() for 'config_test'.
- drupal_xml_parser_create in core/
includes/ unicode.inc - Prepares a new XML parser.
- entity_crud_hook_test_block_create in core/
modules/ system/ tests/ modules/ entity_crud_hook_test/ entity_crud_hook_test.module - Implements hook_ENTITY_TYPE_create() for block entities.
File
- core/
lib/ Drupal/ Core/ Entity/ entity.api.php, line 808 - Hooks and documentation related to entities.
Code
function hook_ENTITY_TYPE_create(\Drupal\Core\Entity\EntityInterface $entity) {
\Drupal::logger('example')
->info('ENTITY_TYPE created: @label', [
'@label' => $entity
->label(),
]);
}