function BundleClassInheritanceException::__construct

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

Constructs a BundleClassInheritanceException.

Parameters

string $bundle_class: The bundle class which should extend the entity class.

string $entity_class: The entity class which should be extended.

File

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

Class

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

Namespace

Drupal\Core\Entity\Exception

Code

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);
}

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