Exemplo n.º 1
0
 /**
  * {@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);
     }
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     $uids = array_keys($entities);
     \Drupal::service('user.data')->delete(NULL, $uids);
 }
Exemplo n.º 3
0
Arquivo: Node.php Projeto: brstde/gap1
 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $nodes)
 {
     parent::postDelete($storage, $nodes);
     \Drupal::service('node.grant_storage')->deleteNodeRecords(array_keys($nodes));
 }
Exemplo n.º 4
0
 /**
  * {@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));
         }
     }
 }
Exemplo n.º 5
0
 /**
  * {@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);
     }
 }
Exemplo n.º 6
0
 /**
  * {@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);
     }
 }
Exemplo n.º 7
0
 /**
  * {@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);
     }
 }
Exemplo n.º 8
0
 /**
  * {@inheritdoc}
  */
 public static function postDelete(EntityStorageInterface $storage, array $entities)
 {
     parent::postDelete($storage, $entities);
     static::invalidateBlockPluginCache();
 }
Exemplo n.º 9
0
 /**
  * {@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()]);
     }
 }