EntityDataDefinition::getBundles

public EntityDataDefinition::getBundles()

Gets the array of possible entity bundles.

Return value

array|null The array of possible bundles, or NULL for any.

Overrides EntityDataDefinitionInterface::getBundles

File

core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php, line 116

Class

EntityDataDefinition
A typed data definition class for describing entities.

Namespace

Drupal\Core\Entity\TypedData

Code

public function getBundles() {
  $bundle = isset($this->definition['constraints']['Bundle']) ? $this->definition['constraints']['Bundle'] : NULL;
  return is_string($bundle) ? array($bundle) : $bundle;
}
doc_Drupal
2016-10-29 09:04:56
Comments
Leave a Comment

Please login to continue.