You are here

protected function EntityReference::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.

1 call to EntityReference::findEntity()
File::getFile in src/Feeds/Target/File.php
Returns a file id given a url.

File

src/Feeds/Target/EntityReference.php, line 291

Class

EntityReference
Defines an entity reference mapper.

Namespace

Drupal\feeds\Feeds\Target

Code

protected function findEntity(string $field, $search) {
  $entities = $this
    ->findEntities($field, $search);
  if (!empty($entities)) {
    return reset($entities);
  }
  return FALSE;
}