You are here

protected static function MediaTarget::isMedia in Media Feeds 8

Parameters

FieldDefinitionInterface $field:

Return value

bool

2 calls to MediaTarget::isMedia()
MediaTarget::prepareTarget in src/Feeds/Target/MediaTarget.php
@inheritdoc
MediaTarget::__construct in src/Feeds/Target/MediaTarget.php
Constructs a new EntityReference object.

File

src/Feeds/Target/MediaTarget.php, line 222

Class

MediaTarget
Defines a wrapper target around a paragraph bundle's target field.

Namespace

Drupal\media_feeds\Feeds\Target

Code

protected static function isMedia(FieldDefinitionInterface $field) {
  $info = null;
  $handler = $field
    ->getSetting('handler');
  if (!isset($media)) {
    $entityType = $field
      ->getTargetEntityTypeId();
    if ($entityType === 'media') {
      return true;
    }
  }
  return $handler === 'default:media';
}