当前位置: 首页>>代码示例>>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;未经允许,请勿转载。