You are here

public function EntityProcessorBase::bundleOptions in Feeds 8.3

Provides a list of bundle options for use in select lists.

Return value

array A keyed array of bundle => label.

1 call to EntityProcessorBase::bundleOptions()
EntityProcessorBase::buildAdvancedForm in src/Feeds/Processor/EntityProcessorBase.php

File

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

Class

EntityProcessorBase
Defines a base entity processor.

Namespace

Drupal\feeds\Feeds\Processor

Code

public function bundleOptions() {
  $options = [];
  foreach ($this->entityTypeBundleInfo
    ->getBundleInfo($this
    ->entityType()) as $bundle => $info) {
    if (!empty($info['label'])) {
      $options[$bundle] = $info['label'];
    }
    else {
      $options[$bundle] = $bundle;
    }
  }
  return $options;
}