/** * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $entities) { parent::postDelete($storage, $entities); // Reset caches. $storage->resetCache(array_keys($entities)); if (reset($entities)->isSyncing()) { return; } $vocabularies = array(); foreach ($entities as $vocabulary) { $vocabularies[$vocabulary->id()] = $vocabulary->id(); } // Load all Taxonomy module fields and delete those which use only this // vocabulary. $field_storages = entity_load_multiple_by_properties('field_storage_config', array('module' => 'taxonomy')); foreach ($field_storages as $field_storage) { $modified_storage = FALSE; // Term reference fields may reference terms from more than one // vocabulary. foreach ($field_storage->getSetting('allowed_values') as $key => $allowed_value) { if (isset($vocabularies[$allowed_value['vocabulary']])) { $allowed_values = $field_storage->getSetting('allowed_values'); unset($allowed_values[$key]); $field_storage->setSetting('allowed_values', $allowed_values); $modified_storage = TRUE; } } if ($modified_storage) { $allowed_values = $field_storage->getSetting('allowed_values'); if (empty($allowed_values)) { $field_storage->delete(); } else { // Update the field definition with the new allowed values. $field_storage->save(); } } } }
/** * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $entities) { parent::postDelete($storage, $entities); // Clear the node type cache to reflect the removal. $storage->resetCache(array_keys($entities)); }
/** * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $entities) { parent::postDelete($storage, $entities); foreach ($entities as $queue) { $queue->getHandlerPlugin()->onQueuePostDelete($queue, $storage); } }
/** * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $entities) { parent::postDelete($storage, $entities); // Clear the cache. $storage->resetCache(array($entities)); }
/** * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $entities) { parent::postDelete($storage, $entities); foreach ($entities as $entity) { entity_invoke_bundle_hook('delete', 'block_content', $entity->id()); } }