public EntityType::getBundleConfigDependency($bundle)
Gets the config dependency info for this entity, if any exists.
string $bundle: The bundle name.
array An associative array containing the following keys:
Overrides EntityTypeInterface::getBundleConfigDependency
public function getBundleConfigDependency($bundle) { // If this entity type uses entities to manage its bundles then depend on // the bundle entity. if ($bundle_entity_type_id = $this->getBundleEntityType()) { if (!$bundle_entity = \Drupal::entityManager()->getStorage($bundle_entity_type_id)->load($bundle)) { throw new \LogicException(sprintf('Missing bundle entity, entity type %s, entity id %s.', $bundle_entity_type_id, $bundle)); } $config_dependency = [ 'type' => 'config', 'name' => $bundle_entity->getConfigDependencyName(), ]; } else { // Depend on the provider of the entity type. $config_dependency = [ 'type' => 'module', 'name' => $this->getProvider(), ]; } return $config_dependency; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityType.php/function/EntityType::getBundleConfigDependency/8.1.x