public function BundleEntityStorageInterface::getBundleFromClass in Drupal 10
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;