You are here

protected function ContentHubEntitiesTracking::setImportStatus in Acquia Content Hub 8

Sets the Import Status.

Parameters

string $status_import: See the constants for possible values.

Return value

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

Throws

\Exception When trying to set status as "IS_DEPENDENT", which is immutable.

4 calls to ContentHubEntitiesTracking::setImportStatus()
ContentHubEntitiesTracking::setAutoUpdate in src/ContentHubEntitiesTracking.php
Sets the entity to auto-update.
ContentHubEntitiesTracking::setDependent in src/ContentHubEntitiesTracking.php
Sets the entity to the state of "is a dependent".
ContentHubEntitiesTracking::setLocalChange in src/ContentHubEntitiesTracking.php
Sets the entity to the state of "has local change".
ContentHubEntitiesTracking::setPendingSync in src/ContentHubEntitiesTracking.php
Sets the entity to the state of "pending synchronization from Content Hub".

File

src/ContentHubEntitiesTracking.php, line 441

Class

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

Namespace

Drupal\acquia_contenthub

Code

protected function setImportStatus($status_import) {
  if ($this
    ->isDependent()) {
    throw new \Exception('The "IS_DEPENDENT" status is immutable, and cannot be set again.');
  }
  $this
    ->getTrackingEntity()->status_import = $status_import;
  return $this;
}