You are here

protected function ExtraFieldManagerBase::allEntityBundles in Extra Field 8.2

Returns the bundles that are defined for an entity type.

Parameters

string $entityType: The entity type to get the bundles for.

Return value

string[] Array of bundle names.

1 call to ExtraFieldManagerBase::allEntityBundles()
ExtraFieldManagerBase::supportedEntityBundles in src/Plugin/ExtraFieldManagerBase.php
Returns entity-bundle combinations this plugin supports.

File

src/Plugin/ExtraFieldManagerBase.php, line 119

Class

ExtraFieldManagerBase
Base class for Extra Field plugin managers.

Namespace

Drupal\extra_field\Plugin

Code

protected function allEntityBundles($entityType) {
  if (!isset($this->entityBundles[$entityType])) {
    $bundleType = $this
      ->getEntityBundleType($entityType);
    if ($bundleType) {
      $bundles = $this
        ->getEntityBundles($bundleType);
    }
    else {
      $bundles = [
        $entityType => $entityType,
      ];
    }
    $this->entityBundles[$entityType] = $bundles;
  }
  return $this->entityBundles[$entityType];
}