You are here

protected function EntityHandlerBase::ignorePull in CMS Content Sync 8

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

Check if the pull should be ignored.

Return value

bool Whether or not to ignore this pull request

5 calls to EntityHandlerBase::ignorePull()
DefaultMenuLinkContentHandler::ignorePull in src/Plugin/cms_content_sync/entity_handler/DefaultMenuLinkContentHandler.php
Check if the pull should be ignored.
DefaultNodeHandler::ignorePull in src/Plugin/cms_content_sync/entity_handler/DefaultNodeHandler.php
Check if the pull should be ignored.
DefaultTaxonomyHandler::pull in src/Plugin/cms_content_sync/entity_handler/DefaultTaxonomyHandler.php
Pull the remote entity.
EntityHandlerBase::pull in src/Plugin/EntityHandlerBase.php
Pull the remote entity.
EntityHandlerBase::setEntityValues in src/Plugin/EntityHandlerBase.php
Set the values for the pulled entity.
2 methods override EntityHandlerBase::ignorePull()
DefaultMenuLinkContentHandler::ignorePull in src/Plugin/cms_content_sync/entity_handler/DefaultMenuLinkContentHandler.php
Check if the pull should be ignored.
DefaultNodeHandler::ignorePull in src/Plugin/cms_content_sync/entity_handler/DefaultNodeHandler.php
Check if the pull should be ignored.

File

src/Plugin/EntityHandlerBase.php, line 390

Class

EntityHandlerBase
Common base class for entity handler plugins.

Namespace

Drupal\cms_content_sync\Plugin

Code

protected function ignorePull(PullIntent $intent) {
  $reason = $intent
    ->getReason();
  $action = $intent
    ->getAction();
  if (PullIntent::PULL_AUTOMATICALLY == $reason) {
    if (PullIntent::PULL_MANUALLY == $this->settings['import']) {

      // Once pulled manually, updates will arrive automatically.
      if (PullIntent::PULL_AUTOMATICALLY != $reason || PullIntent::PULL_MANUALLY != $this->settings['import'] || SyncIntent::ACTION_CREATE == $action) {
        return true;
      }
    }
  }
  if (SyncIntent::ACTION_UPDATE == $action) {
    $behavior = $this->settings['import_updates'];
    if (PullIntent::PULL_UPDATE_IGNORE == $behavior) {
      return true;
    }
  }
  return false;
}