You are here

public function ContentHubEntitiesTracking::delete in Acquia Content Hub 8

Deletes the entry for this particular entity.

File

src/ContentHubEntitiesTracking.php, line 594

Class

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

Namespace

Drupal\acquia_contenthub

Code

public function delete() {
  $entity_type = $this
    ->getEntityType();
  $entity_id = $this
    ->getEntityId();
  if (!empty($entity_type) && !empty($entity_id)) {
    unset($this->cachedTrackingEntities[$entity_type][$entity_id]);
    return $this->database
      ->delete(self::TABLE)
      ->condition('entity_type', $this
      ->getEntityType())
      ->condition('entity_id', $this
      ->getEntityId())
      ->execute();
  }
  if (Uuid::isValid($this
    ->getUuid())) {
    return $this->database
      ->delete(self::TABLE)
      ->condition('entity_uuid', $this
      ->getUuid())
      ->execute();
  }
  return FALSE;
}