function 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 500  
Class
- FieldStorageConfig
 - Defines the Field storage configuration entity.
 
Namespace
Drupal\field\EntityCode
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.