You are here

protected function ContentEntity::getEntityBundleOptions in Search API 8

Retrieves the available bundles of this entity type as an options list.

Return value

array An associative array of bundle labels, keyed by the bundle name.

1 call to ContentEntity::getEntityBundleOptions()
ContentEntity::buildConfigurationForm in src/Plugin/search_api/datasource/ContentEntity.php
Form constructor.

File

src/Plugin/search_api/datasource/ContentEntity.php, line 617

Class

ContentEntity
Represents a datasource which exposes the content entities.

Namespace

Drupal\search_api\Plugin\search_api\datasource

Code

protected function getEntityBundleOptions() {
  $options = [];
  if ($bundles = $this
    ->getEntityBundles()) {
    foreach ($bundles as $bundle => $bundle_info) {
      $options[$bundle] = Utility::escapeHtml($bundle_info['label']);
    }
  }
  return $options;
}