Overrides DatabaseStorageController::invokeHook().
Invokes field API attachers with a BC entity.
Overrides DatabaseStorageControllerNG::invokeHook
protected function invokeHook($hook, EntityInterface $entity) {
$function = 'field_attach_' . $hook;
// @todo: field_attach_delete_revision() is named the wrong way round,
// consider renaming it.
if ($function == 'field_attach_revision_delete') {
$function = 'field_attach_delete_revision';
}
if (!empty($this->entityInfo['fieldable']) && function_exists($function)) {
$function($entity
->getBCEntity());
}
// Invoke the hook.
\Drupal::moduleHandler()
->invokeAll($this->entityType . '_' . $hook, array(
$entity
->getBCEntity(),
));
// Invoke the respective entity-level hook.
\Drupal::moduleHandler()
->invokeAll('entity_' . $hook, array(
$entity
->getBCEntity(),
$this->entityType,
));
}