class AmbiguousBundleClassException in Drupal 10
Exception thrown if a bundle class is defined for multiple bundles.
Hierarchy
- class \Drupal\Core\Entity\Exception\AmbiguousEntityClassException extends \Drupal\Core\Entity\Exception\Exception
- class \Drupal\Core\Entity\Exception\AmbiguousBundleClassException
Expanded class hierarchy of AmbiguousBundleClassException
See also
\Drupal\Core\Entity\ContentEntityStorageBase::getBundleFromClass()
\Drupal\Core\Entity\EntityTypeRepository::getEntityTypeFromClass()
3 files declare their use of AmbiguousBundleClassException
- BundleClassTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Entity/ BundleClassTest.php - ContentEntityStorageBase.php in core/
lib/ Drupal/ Core/ Entity/ ContentEntityStorageBase.php - EntityTypeRepository.php in core/
lib/ Drupal/ Core/ Entity/ EntityTypeRepository.php
File
- core/
lib/ Drupal/ Core/ Entity/ Exception/ AmbiguousBundleClassException.php, line 11
Namespace
Drupal\Core\Entity\ExceptionView source
class AmbiguousBundleClassException extends AmbiguousEntityClassException {
/**
* Constructs an AmbiguousBundleClassException.
*
* @param string $class
* The bundle class which is defined for multiple bundles.
*/
public function __construct(string $class) {
$message = sprintf('Multiple bundles are using the bundle class %s.', $class);
parent::__construct($message);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AmbiguousBundleClassException:: |
public | function |
Constructs an AmbiguousBundleClassException. Overrides AmbiguousEntityClassException:: |