You are here

protected function DedupeEntity::exists in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php \Drupal\migrate\Plugin\migrate\process\DedupeEntity::exists()

This is a query checking the existence of some value.

Parameters

mixed $value: The value to check.

Return value

bool TRUE if the value exists.

Overrides DedupeBase::exists

File

core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php, line 53
Contains \Drupal\migrate\Plugin\migrate\process\DedupeEntity.

Class

DedupeEntity
Ensures value is not duplicated against an entity field.

Namespace

Drupal\migrate\Plugin\migrate\process

Code

protected function exists($value) {

  // Plugins are cached so for every run we need a new query object.
  return $this->entityQueryFactory
    ->get($this->configuration['entity_type'], 'AND')
    ->condition($this->configuration['field'], $value)
    ->count()
    ->execute();
}