You are here

protected function ConfigEntityReference::findEntity in Feeds 8.3

Searches for an entity by entity key.

Parameters

string $field: The subfield to search in.

string $search: The value to search for.

Return value

int|bool The entity id, or false, if not found.

2 calls to ConfigEntityReference::findEntity()
ConfigEntityReference::prepareValue in src/Feeds/Target/ConfigEntityReference.php
Prepares a single value.
UserRole::findEntity in src/Feeds/Target/UserRole.php
Searches for an entity by entity key.
1 method overrides ConfigEntityReference::findEntity()
UserRole::findEntity in src/Feeds/Target/UserRole.php
Searches for an entity by entity key.

File

src/Feeds/Target/ConfigEntityReference.php, line 235

Class

ConfigEntityReference
Defines a config entity reference mapper.

Namespace

Drupal\feeds\Feeds\Target

Code

protected function findEntity(string $field, $search) {
  $ids = $this->entityFinder
    ->findEntities($this
    ->getEntityType(), $field, $search);
  if ($ids) {
    return reset($ids);
  }
  return FALSE;
}