You are here

public static function PullIntent::entityHasBeenPulledFromRemoteSite in CMS Content Sync 8

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

Check if the provided entity has just been pulled by Sync Core in this very request. In this case it doesn't make sense to perform a remote request telling Sync Core it has been created/updated/deleted (it will know as a result of this current request).

Parameters

string $entity_type: The entity type

string $entity_uuid: The entity UUID

bool $set: If TRUE, this entity will be set to have been pulled at this request

Return value

bool

4 calls to PullIntent::entityHasBeenPulledFromRemoteSite()
cms_content_sync_entity_delete in ./cms_content_sync.module
Push the entity deletion automatically if configured to do so.
PullIntent::execute in src/PullIntent.php
Pull the provided entity.
PushIntent::execute in src/PushIntent.php
Push the given entity.
PushIntent::__construct in src/PushIntent.php
PushIntent constructor.

File

src/PullIntent.php, line 350

Class

PullIntent

Namespace

Drupal\cms_content_sync

Code

public static function entityHasBeenPulledFromRemoteSite($entity_type = null, $entity_uuid = null, $set = false) {
  static $entities = [];
  if (!$entity_type) {
    return !empty($entities);
  }
  if ($set) {
    return $entities[$entity_type][$entity_uuid] = true;
  }
  return !empty($entities[$entity_type][$entity_uuid]);
}