You are here

public static function PushIntent::getNoPushReason in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/PushIntent.php \Drupal\cms_content_sync\PushIntent::getNoPushReason()
  2. 2.0.x src/PushIntent.php \Drupal\cms_content_sync\PushIntent::getNoPushReason()

Get the reason why a push has not happened.

Parameters

\Drupal\Core\Entity\EntityInterface $entity:

bool $as_message:

Return value

null|Exception|string see self::$noPushReasons

2 calls to PushIntent::getNoPushReason()
cms_content_sync_entity_delete in ./cms_content_sync.module
Push the entity deletion automatically if configured to do so.
PushChanges::pushChanges in src/Controller/PushChanges.php
Published entity to Sync Core.

File

src/PushIntent.php, line 667

Class

PushIntent
Class PushIntent.

Namespace

Drupal\cms_content_sync

Code

public static function getNoPushReason($entity, $as_message = false) {

  // If push wasn't even tried, no pool has been assigned.
  if (empty(self::$noPushReasons[$entity
    ->getEntityTypeId()][$entity
    ->uuid()])) {
    $issue = self::NO_PUSH_REASON__NO_POOL;
  }
  else {
    $issue = self::$noPushReasons[$entity
      ->getEntityTypeId()][$entity
      ->uuid()];
  }
  if ($as_message) {
    return self::displayNoPushReason($issue);
  }
  return $issue;
}