You are here

public function SubscriberTracker::isTracked in Acquia Content Hub 8.2

Checks if a particular entity uuid is tracked.

Parameters

mixed $uuids: The uuid of an entity.

Return value

bool Whether or not the entity is tracked in the subscriber tables.

2 calls to SubscriberTracker::isTracked()
SubscriberTracker::setQueueItemByUuids in modules/acquia_contenthub_subscriber/src/SubscriberTracker.php
Set the queue item of a particular record by its uuid.
SubscriberTracker::setStatusByUuid in modules/acquia_contenthub_subscriber/src/SubscriberTracker.php
Set the status of a particular item by its uuid.

File

modules/acquia_contenthub_subscriber/src/SubscriberTracker.php, line 55

Class

SubscriberTracker
Subscriber Tracker database table methods.

Namespace

Drupal\acquia_contenthub_subscriber

Code

public function isTracked($uuids) {
  if (!is_array($uuids)) {
    $uuids = [
      $uuids,
    ];
  }
  $query = $this->database
    ->select(self::IMPORT_TRACKING_TABLE, 't');
  $query
    ->fields('t', [
    'entity_type',
    'entity_id',
    'entity_uuid',
  ]);
  $query
    ->condition('entity_uuid', $uuids, 'IN');
  $results = $query
    ->execute()
    ->fetchAll();
  if (array_diff($uuids, array_column($results, 'entity_uuid'))) {
    return FALSE;
  }
  return TRUE;
}