You are here

public function EntityProcessorBase::defaultConfiguration in Feeds 8.3

Gets default configuration for this plugin.

Return value

array An associative array with the default configuration.

Overrides PluginBase::defaultConfiguration

File

src/Feeds/Processor/EntityProcessorBase.php, line 683

Class

EntityProcessorBase
Defines a base entity processor.

Namespace

Drupal\feeds\Feeds\Processor

Code

public function defaultConfiguration() {
  $defaults = [
    'insert_new' => static::INSERT_NEW,
    'update_existing' => static::SKIP_EXISTING,
    'update_non_existent' => static::KEEP_NON_EXISTENT,
    'skip_hash_check' => FALSE,
    'values' => [],
    'authorize' => $this->entityType
      ->entityClassImplements('Drupal\\user\\EntityOwnerInterface'),
    'expire' => static::EXPIRE_NEVER,
    'owner_id' => 0,
    'owner_feed_author' => 0,
  ];

  // Bundle.
  if ($bundle_key = $this->entityType
    ->getKey('bundle')) {
    $defaults['values'] = [
      $bundle_key => NULL,
    ];
  }

  // Language.
  if ($langcode_key = $this->entityType
    ->getKey('langcode')) {
    $defaults['langcode'] = $this->languageManager
      ->getDefaultLanguage()
      ->getId();
  }
  return $defaults;
}