You are here

protected function EntityReference::filterFieldTypes in Feeds 8.3

Callback for the potential field filter.

Checks whether the provided field is available to be used as reference.

Parameters

\Drupal\Core\Field\FieldStorageDefinitionInterface $field: The field to check.

Return value

bool TRUE if the field can be used as reference otherwise FALSE.

See also

::getPotentialFields()

1 call to EntityReference::filterFieldTypes()
File::filterFieldTypes in src/Feeds/Target/File.php
Filesize and MIME-type aren't sensible fields to match on so these are filtered out.
1 method overrides EntityReference::filterFieldTypes()
File::filterFieldTypes in src/Feeds/Target/File.php
Filesize and MIME-type aren't sensible fields to match on so these are filtered out.

File

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

Class

EntityReference
Defines an entity reference mapper.

Namespace

Drupal\feeds\Feeds\Target

Code

protected function filterFieldTypes(FieldStorageDefinitionInterface $field) {
  if ($field instanceof DataDefinitionInterface && $field
    ->isComputed()) {
    return FALSE;
  }
  switch ($field
    ->getType()) {
    case 'integer':
    case 'string':
    case 'text_long':
    case 'path':
    case 'uuid':
    case 'feeds_item':
      return TRUE;
    default:
      return FALSE;
  }
}