You are here

public function SpoolStorage::deleteMails in Simplenews 8.2

Same name and namespace in other branches
  1. 8 src/Spool/SpoolStorage.php \Drupal\simplenews\Spool\SpoolStorage::deleteMails()
  2. 3.x src/Spool/SpoolStorage.php \Drupal\simplenews\Spool\SpoolStorage::deleteMails()

Remove records from mail spool table according to the conditions.

Return value

int Count deleted

Overrides SpoolStorageInterface::deleteMails

1 call to SpoolStorage::deleteMails()
SpoolStorage::deleteIssue in src/Spool/SpoolStorage.php
Deletes a newsletter issue from the mail spool.

File

src/Spool/SpoolStorage.php, line 219

Class

SpoolStorage
Default database spool storage.

Namespace

Drupal\simplenews\Spool

Code

public function deleteMails(array $conditions) {
  $query = $this->connection
    ->delete('simplenews_mail_spool');
  foreach ($conditions as $condition => $value) {
    $query
      ->condition($condition, $value);
  }
  return $query
    ->execute();
}