class AmbiguousEntityClassException

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Exception/AmbiguousEntityClassException.php \Drupal\Core\Entity\Exception\AmbiguousEntityClassException
  2. 8.9.x core/lib/Drupal/Core/Entity/Exception/AmbiguousEntityClassException.php \Drupal\Core\Entity\Exception\AmbiguousEntityClassException
  3. 11.x 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

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

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