You are here

public function Feed::setConfigurationFor in Feeds 8.3

Sets the configuration for a specific client plugin.

@todo Refactor this. This can cause conflicts if different plugin types use the same id.

Parameters

\Drupal\feeds\Plugin\Type\FeedsPluginInterface $client: A Feeds plugin.

array $config: The configuration for the plugin.

Overrides FeedInterface::setConfigurationFor

File

src/Entity/Feed.php, line 521

Class

Feed
Defines the feed entity class.

Namespace

Drupal\feeds\Entity

Code

public function setConfigurationFor(FeedsPluginInterface $client, array $configuration) {
  $type = $client
    ->pluginType();
  $this
    ->get('config')->{$type} = array_intersect_key($configuration, $client
    ->defaultFeedConfiguration()) + $client
    ->defaultFeedConfiguration();
}