You are here

public function ContentHubEntitiesTracking::deleteExportedEntities in Acquia Content Hub 8

Deletes all or a given set of exported entities from the tracking table.

Parameters

array $uuids: An array of entities' uuids to delete.

Return value

int The output result from the delete query.

File

src/ContentHubEntitiesTracking.php, line 986

Class

ContentHubEntitiesTracking
Tracks in a table the list of all entities imported from Content Hub.

Namespace

Drupal\acquia_contenthub

Code

public function deleteExportedEntities(array $uuids = []) {
  $query = $this->database
    ->delete(self::TABLE)
    ->condition('status_export', [
    self::QUEUED,
    self::INITIATED,
    self::EXPORTED,
  ], 'IN');

  // If a set of uuids were given.
  if (count($uuids) > 0) {
    $query
      ->condition('entity_uuid', $uuids, 'IN');
  }

  // Delete entities.
  return $query
    ->execute();
}