FieldStorageConfig::getBundles

public FieldStorageConfig::getBundles()

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

Return value

array An array of bundle names.

Overrides FieldStorageConfigInterface::getBundles

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 495

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();
}
doc_Drupal
2016-10-29 09:12:17
Comments
Leave a Comment

Please login to continue.