You are here

public function FieldStorageConfig::getBundles in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getBundles()

Returns the list of bundles where the field storage has fields.

Return value

array An array of bundle names.

Overrides FieldStorageConfigInterface::getBundles

1 call to FieldStorageConfig::getBundles()
FieldStorageConfig::isDeletable in core/modules/field/src/Entity/FieldStorageConfig.php
Checks if the field storage can be deleted.

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 499
Contains \Drupal\field\Entity\FieldStorageConfig.

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

public function getBundles() {
  if (!$this
    ->isDeleted()) {
    $map = \Drupal::entityManager()
      ->getFieldMap();
    if (isset($map[$this
      ->getTargetEntityTypeId()][$this
      ->getName()]['bundles'])) {
      return $map[$this
        ->getTargetEntityTypeId()][$this
        ->getName()]['bundles'];
    }
  }
  return array();
}