当前位置: 首页>>代码示例>>PHP>>正文


PHP ContentEntityBase::postDelete方法代码示例

本文整理汇总了PHP中Drupal\Core\Entity\ContentEntityBase::postDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentEntityBase::postDelete方法的具体用法?PHP ContentEntityBase::postDelete怎么用?PHP ContentEntityBase::postDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Drupal\Core\Entity\ContentEntityBase的用法示例。


在下文中一共展示了ContentEntityBase::postDelete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     // See if any of the term's children are about to be become orphans.
     $orphans = array();
     foreach (array_keys($entities) as $tid) {
         if ($children = taxonomy_term_load_children($tid)) {
             foreach ($children as $child) {
                 // If the term has multiple parents, we don't delete it.
                 $parents = taxonomy_term_load_parents($child->id());
                 if (empty($parents)) {
                     $orphans[] = $child->id();
                 }
             }
         }
     }
     // Delete term hierarchy information after looking up orphans but before
     // deleting them so that their children/parent information is consistent.
     $storage->deleteTermHierarchy(array_keys($entities));
     if (!empty($orphans)) {
         entity_delete_multiple('taxonomy_term', $orphans);
     }
 }
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:26,代码来源:Term.php

示例2: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     $uids = array_keys($entities);
     \Drupal::service('user.data')->delete(NULL, $uids);
 }
开发者ID:ravindrasingh22,项目名称:Drupal-8-rc,代码行数:9,代码来源:User.php

示例3: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $nodes)
 {
     parent::postDelete($storage, $nodes);
     \Drupal::service('node.grant_storage')->deleteNodeRecords(array_keys($nodes));
 }
开发者ID:brstde,项目名称:gap1,代码行数:8,代码来源:Node.php

示例4: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     if (\Drupal::moduleHandler()->moduleExists('block')) {
         // Make sure there are no active blocks for these feeds.
         $ids = \Drupal::entityQuery('block')->condition('plugin', 'aggregator_feed_block')->condition('settings.feed', array_keys($entities))->execute();
         if ($ids) {
             $block_storage = \Drupal::entityManager()->getStorage('block');
             $block_storage->delete($block_storage->loadMultiple($ids));
         }
     }
 }
开发者ID:papillon-cendre,项目名称:d8,代码行数:15,代码来源:Feed.php

示例5: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     $child_cids = $storage->getChildCids($entities);
     entity_delete_multiple('comment', $child_cids);
     foreach ($entities as $id => $entity) {
         \Drupal::service('comment.statistics')->update($entity);
     }
 }
开发者ID:brstde,项目名称:gap1,代码行数:12,代码来源:Comment.php

示例6: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     // Since we are deleting one or multiple job items here we also need to
     // delete the attached messages.
     $mids = \Drupal::entityQuery('tmgmt_message')->condition('tjiid', array_keys($entities), 'IN')->execute();
     if (!empty($mids)) {
         entity_delete_multiple('tmgmt_message', $mids);
     }
     $trids = \Drupal::entityQuery('tmgmt_remote')->condition('tjiid', array_keys($entities), 'IN')->execute();
     if (!empty($trids)) {
         entity_delete_multiple('tmgmt_remote', $trids);
     }
 }
开发者ID:andrewl,项目名称:andrewlnet,代码行数:17,代码来源:JobItem.php

示例7: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     $ids = \Drupal::entityQuery('tmgmt_local_task_item')->condition('tltid', array_keys($entities), 'IN')->execute();
     if (!empty($ids)) {
         $storage_handler = \Drupal::entityTypeManager()->getStorage('tmgmt_local_task_item');
         $entities = $storage_handler->loadMultiple($ids);
         $storage_handler->delete($entities);
     }
 }
开发者ID:andrewl,项目名称:andrewlnet,代码行数:13,代码来源:LocalTask.php

示例8: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     static::invalidateBlockPluginCache();
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:8,代码来源:BlockContent.php

示例9: postDelete

 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $orders)
 {
     parent::postDelete($storage, $orders);
     // Delete data from the appropriate Ubercart order tables.
     $ids = array_keys($orders);
     $result = \Drupal::entityQuery('uc_order_product')->condition('order_id', $ids, 'IN')->execute();
     if (!empty($result)) {
         entity_delete_multiple('uc_order_product', array_keys($result));
     }
     db_delete('uc_order_comments')->condition('order_id', $ids, 'IN')->execute();
     db_delete('uc_order_admin_comments')->condition('order_id', $ids, 'IN')->execute();
     db_delete('uc_order_log')->condition('order_id', $ids, 'IN')->execute();
     foreach ($orders as $order_id => $order) {
         // Delete line items for the order.
         uc_order_delete_line_item($order_id, TRUE);
         // Log the action in the database.
         \Drupal::logger('uc_order')->notice('Order @order_id deleted by user @uid.', ['@order_id' => $order_id, '@uid' => \Drupal::currentUser()->id()]);
     }
 }
开发者ID:justincletus,项目名称:webdrupalpro,代码行数:22,代码来源:Order.php


注:本文中的Drupal\Core\Entity\ContentEntityBase::postDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。