You are here

public function PushQueue::deleteItemByEntity in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 modules/salesforce_push/src/PushQueue.php \Drupal\salesforce_push\PushQueue::deleteItemByEntity()
  2. 5.0.x modules/salesforce_push/src/PushQueue.php \Drupal\salesforce_push\PushQueue::deleteItemByEntity()

For a given entity, delete its corresponding queue items.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity whose items should be deleted.

Throws

\Exception

File

modules/salesforce_push/src/PushQueue.php, line 586

Class

PushQueue
Salesforce push queue.

Namespace

Drupal\salesforce_push

Code

public function deleteItemByEntity(EntityInterface $entity) {
  try {
    $this->connection
      ->delete(static::TABLE_NAME)
      ->condition('entity_id', $entity
      ->id())
      ->condition('name', $this->name)
      ->execute();
  } catch (\Exception $e) {
    $this
      ->catchException($e);
  }
}