class AmbiguousBundleClassException

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Exception/AmbiguousBundleClassException.php \Drupal\Core\Entity\Exception\AmbiguousBundleClassException
  2. 11.x core/lib/Drupal/Core/Entity/Exception/AmbiguousBundleClassException.php \Drupal\Core\Entity\Exception\AmbiguousBundleClassException

Exception thrown if a bundle class is defined for multiple bundles.

Hierarchy

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\Exception
View 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

Title Sort descending Modifiers Object type Summary Overriden Title
AmbiguousBundleClassException::__construct public function Constructs an AmbiguousBundleClassException. Overrides AmbiguousEntityClassException::__construct

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.