You are here

public function SubscriberTracker::getUntracked in Acquia Content Hub 8.2

Gets a list of uuids that are not yet tracked.

Parameters

string[] $uuids: List of UUID strings.

Return value

array The list of UUIDs of untracked entities.

File

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

Class

SubscriberTracker
Subscriber Tracker database table methods.

Namespace

Drupal\acquia_contenthub_subscriber

Code

public function getUntracked(array $uuids) {
  $query = $this->database
    ->select(self::IMPORT_TRACKING_TABLE, 't')
    ->fields('t');
  $query
    ->condition('t.entity_uuid', $uuids, 'IN');
  $query
    ->condition('t.entity_id', NULL, 'IS NOT NULL');
  $results = $query
    ->execute();
  $uuids = array_combine($uuids, $uuids);
  foreach ($results as $result) {

    // @todo this should be compared against a known hash.
    if ($result->hash) {
      unset($uuids[$result->entity_uuid]);
    }
  }
  return array_values($uuids);
}