當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ConfigEntityBase::postDelete方法代碼示例

本文整理匯總了PHP中Drupal\Core\Config\Entity\ConfigEntityBase::postDelete方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigEntityBase::postDelete方法的具體用法?PHP ConfigEntityBase::postDelete怎麽用?PHP ConfigEntityBase::postDelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Config\Entity\ConfigEntityBase的用法示例。


在下文中一共展示了ConfigEntityBase::postDelete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     foreach ($entities as $entity) {
         entity_invoke_bundle_hook('delete', $entity->getEntityType()->getBundleOf(), $entity->id());
     }
 }
開發者ID:anatalsceo,項目名稱:en-classe,代碼行數:10,代碼來源:ConfigEntityBundleBase.php

示例2: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     foreach ($entities as $entity) {
         $entity->deleteDisplays();
         \Drupal::entityManager()->onBundleDelete($entity->id(), $entity->getEntityType()->getBundleOf());
     }
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:11,代碼來源:ConfigEntityBundleBase.php

示例3: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     foreach ($entities as $style) {
         // Flush cached media for the deleted style.
         $style->flush();
         // Check whether field settings need to be updated.
         // In case no replacement style was specified, all image fields that are
         // using the deleted style are left in a broken state.
         if (!$style->isSyncing() && ($new_id = $style->getReplacementID())) {
             // The deleted ID is still set as originalID.
             $style->setName($new_id);
             static::replaceImageStyle($style);
         }
     }
 }
開發者ID:RealLukeMartin,項目名稱:drupal8tester,代碼行數:19,代碼來源:ImageStyle.php

示例4: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     $tempstore = \Drupal::service('user.tempstore')->get('views');
     foreach ($entities as $entity) {
         $tempstore->delete($entity->id());
     }
 }
開發者ID:shumer,項目名稱:blog,代碼行數:11,代碼來源:View.php

示例5: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     /** @var \Drupal\image\ImageStyleInterface[] $entities */
     foreach ($entities as $style) {
         // Flush cached media for the deleted style.
         $style->flush();
         // Clear the replacement ID, if one has been previously stored.
         /** @var \Drupal\image\ImageStyleStorageInterface $storage */
         $storage->clearReplacementId($style->id());
     }
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:15,代碼來源:ImageStyle.php

示例6: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     // Invalidate the static caches.
     \Drupal::service('pathauto.generator')->resetCaches();
 }
開發者ID:CIGIHub,項目名稱:bsia-drupal8,代碼行數:9,代碼來源:PathautoPattern.php

示例7: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     /** @var \Drupal\commerce_tax\Entity\TaxTypeInterface[] $entities */
     parent::postDelete($storage, $entities);
     // Delete the tax rates of each tax type.
     $rates = [];
     foreach ($entities as $entity) {
         foreach ($entity->getRates() as $rate) {
             $rates[$rate->id()] = $rate;
         }
     }
     /** @var \Drupal\Core\Entity\EntityStorageInterface $rate_storage */
     $rate_storage = \Drupal::service('entity_type.manager')->getStorage('commerce_tax_rate');
     $rate_storage->delete($rates);
 }
開發者ID:alexburrows,項目名稱:cream-2.x,代碼行數:18,代碼來源:TaxType.php

示例8: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     // Remove file usage for any button icons.
     foreach ($entities as $entity) {
         /** @var \Drupal\embed\EmbedButtonInterface $entity */
         if ($icon_file = $entity->getIconFile()) {
             \Drupal::service('file.usage')->delete($icon_file, 'embed', $entity->getEntityTypeId(), $entity->id());
         }
     }
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:14,代碼來源:EmbedButton.php

示例9: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     static::routeBuilder()->setRebuildNeeded();
 }
開發者ID:neeravbm,項目名稱:unify-d8,代碼行數:8,代碼來源:PageVariant.php

示例10: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     if (\Drupal::moduleHandler()->moduleExists('views')) {
         Views::viewsData()->clear();
         // Remove this line when https://www.drupal.org/node/2370365 gets fixed.
         Cache::invalidateTags(array('extension:views'));
         \Drupal::cache('discovery')->delete('views:wizard');
     }
     /** @var \Drupal\user\SharedTempStore $temp_store */
     $temp_store = \Drupal::service('user.shared_tempstore')->get('search_api_index');
     foreach ($entities as $entity) {
         try {
             $temp_store->delete($entity->id());
         } catch (TempStoreException $e) {
             // Can't really be helped, I guess. But is also very unlikely to happen.
             // Ignore it.
         }
     }
 }
開發者ID:curveagency,項目名稱:intranet,代碼行數:23,代碼來源:Index.php

示例11: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     if ($event_type = reset($entities)) {
         EventType::courierContextCC($event_type->entity_type, 'delete');
     }
     // Rebuild routes and local tasks.
     \Drupal::service('router.builder')->setRebuildNeeded();
     // Rebuild local actions https://github.com/dpi/rng/issues/18
     \Drupal::service('plugin.manager.menu.local_action')->clearCachedDefinitions();
 }
開發者ID:justincletus,項目名稱:webdrupalpro,代碼行數:14,代碼來源:EventType.php

示例12: postDelete

 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     \Drupal::service('router.builder')->setRebuildNeeded();
 }
開發者ID:Jbartsch,項目名稱:travelbruh-api,代碼行數:5,代碼來源:ServiceEndpoint.php

示例13: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     /** @var \Drupal\simplenews\Subscription\SubscriptionManagerInterface $subscription_manager */
     $subscription_manager = \Drupal::service('simplenews.subscription_manager');
     foreach ($entities as $newsletter) {
         $subscription_manager->deleteSubscriptions(array('subscriptions_target_id' => $newsletter->id()));
         drupal_set_message(t('All subscriptions to newsletter %newsletter have been deleted.', array('%newsletter' => $newsletter->label())));
     }
     if (\Drupal::moduleHandler()->moduleExists('block')) {
         // Make sure there are no active blocks for these newsletters.
         $ids = \Drupal::entityQuery('block')->condition('plugin', 'simplenews_subscription_block')->condition('settings.newsletters.*', array_keys($entities), 'IN')->execute();
         if ($ids) {
             $blocks = Block::loadMultiple($ids);
             foreach ($blocks as $block) {
                 $settings = $block->get('settings');
                 foreach ($entities as $newsletter) {
                     if (in_array($newsletter->id(), $settings['newsletters'])) {
                         unset($settings['newsletters'][array_search($newsletter->id(), $settings['newsletters'])]);
                     }
                 }
                 // If there are no enabled newsletters left, delete the block.
                 if (empty($settings['newsletters'])) {
                     $block->delete();
                 } else {
                     // otherwise, update the settings and save.
                     $block->set('settings', $settings);
                     $block->save();
                 }
             }
         }
     }
 }
開發者ID:aritnath1990,項目名稱:simplenewslatest,代碼行數:36,代碼來源:Newsletter.php

示例14: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     $search_page_repository = \Drupal::service('search.search_page_repository');
     if (!$search_page_repository->isSearchActive()) {
         $search_page_repository->clearDefaultSearchPage();
     }
 }
開發者ID:aWEBoLabs,項目名稱:taxi,代碼行數:11,代碼來源:SearchPage.php

示例15: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     /** @var \Drupal\commerce_tax\Entity\TaxRateInterface $entity */
     parent::postDelete($storage, $entities);
     // Delete the tax rates amounts of each tax rate.
     $amounts = [];
     foreach ($entities as $entity) {
         foreach ($entity->getAmounts() as $amount) {
             $amounts[$amount->id()] = $amount;
         }
     }
     /** @var \Drupal\Core\Entity\EntityStorageInterface $rate_storage */
     $amount_storage = \Drupal::service('entity_type.manager')->getStorage('commerce_tax_rate_amount');
     $amount_storage->delete($amounts);
 }
開發者ID:alexburrows,項目名稱:cream-2.x,代碼行數:18,代碼來源:TaxRate.php


注:本文中的Drupal\Core\Config\Entity\ConfigEntityBase::postDelete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。