Overrides DatabaseStorageController::invokeHook().
Invokes field API attachers in compatibility mode and disables it afterwards.
Overrides DatabaseStorageController::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)) {
$entity
->setCompatibilityMode(TRUE);
$function($this->entityType, $entity);
$entity
->setCompatibilityMode(FALSE);
}
// Invoke the hook.
module_invoke_all($this->entityType . '_' . $hook, $entity);
// Invoke the respective entity-level hook.
module_invoke_all('entity_' . $hook, $entity, $this->entityType);
}