function BundleEntityStorageInterface::getBundleFromClass
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/BundleEntityStorageInterface.php \Drupal\Core\Entity\BundleEntityStorageInterface::getBundleFromClass()
- 10 core/lib/Drupal/Core/Entity/BundleEntityStorageInterface.php \Drupal\Core\Entity\BundleEntityStorageInterface::getBundleFromClass()
Retrieves the bundle name for a provided class name.
Parameters
string $class_name: The class name to check.
Return value
string|null The bundle name of the class provided or NULL if unable to determine the bundle from the provided class.
Throws
\Drupal\Core\Entity\Exception\AmbiguousBundleClassException Thrown when multiple bundles are using the provided class.
1 method overrides BundleEntityStorageInterface::getBundleFromClass()
- ContentEntityStorageBase::getBundleFromClass in core/
lib/ Drupal/ Core/ Entity/ ContentEntityStorageBase.php - Retrieves the bundle name for a provided class name.
File
-
core/
lib/ Drupal/ Core/ Entity/ BundleEntityStorageInterface.php, line 23
Class
- BundleEntityStorageInterface
- A storage that supports entities with bundle specific classes.
Namespace
Drupal\Core\EntityCode
public function getBundleFromClass(string $class_name) : ?string;
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.