class BundleClassInheritanceException

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

Exception thrown if a bundle class does not extend the main entity class.

Hierarchy

Expanded class hierarchy of BundleClassInheritanceException

See also

\Drupal\Core\Entity\ContentEntityStorageBase::getEntityClass()

2 files declare their use of BundleClassInheritanceException
BundleClassTest.php in core/tests/Drupal/KernelTests/Core/Entity/BundleClassTest.php
ContentEntityStorageBase.php in core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php

File

core/lib/Drupal/Core/Entity/Exception/BundleClassInheritanceException.php, line 10

Namespace

Drupal\Core\Entity\Exception
View source
class BundleClassInheritanceException extends \Exception {
    
    /**
     * Constructs a BundleClassInheritanceException.
     *
     * @param string $bundle_class
     *   The bundle class which should extend the entity class.
     * @param string $entity_class
     *   The entity class which should be extended.
     */
    public function __construct(string $bundle_class, string $entity_class) {
        $message = sprintf('Bundle class %s does not extend entity class %s.', $bundle_class, $entity_class);
        parent::__construct($message);
    }

}

Members

Title Sort descending Modifiers Object type Summary
BundleClassInheritanceException::__construct public function Constructs a BundleClassInheritanceException.

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