You are here

protected function EntityProcessorBase::entityExists in Feeds 8.3

Checks if the entity exists already.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to check.

Return value

bool True if the entity already exists, false otherwise.

1 call to EntityProcessorBase::entityExists()
EntityProcessorBase::entityValidate in src/Feeds/Processor/EntityProcessorBase.php

File

src/Feeds/Processor/EntityProcessorBase.php, line 518

Class

EntityProcessorBase
Defines a base entity processor.

Namespace

Drupal\feeds\Feeds\Processor

Code

protected function entityExists(EntityInterface $entity) {
  if ($entity
    ->id()) {
    $result = $this->storageController
      ->getQuery()
      ->condition($this->entityType
      ->getKey('id'), $entity
      ->id())
      ->execute();
    return !empty($result);
  }
  return FALSE;
}