You are here

public function ContentHubEntitiesTracking::loadByUuid in Acquia Content Hub 8

Loads a record using an Entity's UUID.

Parameters

string $entity_uuid: The entity's UUID.

Return value

\Drupal\acquia_contenthub\ContentHubEntitiesTracking|bool This ContentHubEntitiesTracking object if succeeds, FALSE otherwise.

2 calls to ContentHubEntitiesTracking::loadByUuid()
ContentHubEntitiesTracking::loadExportedByUuid in src/ContentHubEntitiesTracking.php
Loads an Exported Entity tracking record by UUID.
ContentHubEntitiesTracking::loadImportedByUuid in src/ContentHubEntitiesTracking.php
Loads an Imported Entity tracking record by UUID.

File

src/ContentHubEntitiesTracking.php, line 727

Class

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

Namespace

Drupal\acquia_contenthub

Code

public function loadByUuid($entity_uuid) {
  if (!Uuid::isValid($entity_uuid)) {
    return FALSE;
  }
  $result = $this->database
    ->select(self::TABLE, 'ci')
    ->fields('ci')
    ->condition('entity_uuid', $entity_uuid)
    ->execute()
    ->fetchAssoc();
  if (!$result) {
    return FALSE;
  }
  $this
    ->setTrackingEntity($result['entity_type'], $result['entity_id'], $result['entity_uuid'], $result['modified'], $result['origin'], $result['status_export'], $result['status_import']);
  return $this;
}