You are here

class AmbiguousEntityClassException in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Exception/AmbiguousEntityClassException.php \Drupal\Core\Entity\Exception\AmbiguousEntityClassException
  2. 10 core/lib/Drupal/Core/Entity/Exception/AmbiguousEntityClassException.php \Drupal\Core\Entity\Exception\AmbiguousEntityClassException

Exception thrown if multiple entity types exist for an entity class.

Hierarchy

Expanded class hierarchy of AmbiguousEntityClassException

See also

hook_entity_info_alter()

2 files declare their use of AmbiguousEntityClassException
EntityTypeRepository.php in core/lib/Drupal/Core/Entity/EntityTypeRepository.php
EntityTypeRepositoryTest.php in core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php

File

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

Namespace

Drupal\Core\Entity\Exception
View source
class AmbiguousEntityClassException extends \Exception {

  /**
   * Constructs an AmbiguousEntityClassException.
   *
   * @param string $class
   *   The entity parent class.
   */
  public function __construct($class) {
    $message = sprintf('Multiple entity types found for %s.', $class);
    parent::__construct($message);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AmbiguousEntityClassException::__construct public function Constructs an AmbiguousEntityClassException.