You are here

public function MediaTarget::createTargetInstance in Media Feeds 8

Return value

null|object

1 call to MediaTarget::createTargetInstance()
MediaTarget::__construct in src/Feeds/Target/MediaTarget.php
Constructs a new EntityReference object.

File

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

Class

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

Namespace

Drupal\media_feeds\Feeds\Target

Code

public function createTargetInstance() {
  $info = $this->field->media_feeds_info;
  $plugin = $info['plugin'];
  $class = $plugin['class'];
  $target = $class::prepareTarget($this->field);
  $target
    ->setPluginId($plugin['id']);
  $instance = null;
  try {
    $instance = $this->plugin_manager
      ->createInstance($plugin['id'], $this->configuration);
  } catch (PluginException $e) {
  }
  return $instance;
}