You are here

private function ReferenceMigrator::entityShouldBeSkipped in Term reference change 8

Determines if an entity should be skipped or not.

Parameters

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

array[] $limit: The entity keys keyed by their entity id used to determine if the given entity should be skipped.

Return value

bool TRUE if the entity should be skipped, FALSE otherwise.

1 call to ReferenceMigrator::entityShouldBeSkipped()
ReferenceMigrator::migrateReference in src/ReferenceMigrator.php
Updates the term reference on all entities from the source to the target.

File

src/ReferenceMigrator.php, line 100

Class

ReferenceMigrator
Migrates references from one taxonomy term to the other.

Namespace

Drupal\term_reference_change

Code

private function entityShouldBeSkipped(EntityInterface $entity, array $limit) {
  if (empty($limit)) {
    return FALSE;
  }
  $entityTypeId = $entity
    ->getEntityTypeId();
  if ($this
    ->entityTypeShouldBeSkipped($entityTypeId, $limit)) {
    return TRUE;
  }
  return !in_array($entity
    ->id(), $limit[$entityTypeId]);
}