function FieldStorageConfig::getBundles

Same name and namespace in other branches
  1. 9 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getBundles()
  2. 10 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getBundles()
  3. 11.x core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::getBundles()

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 497

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.