class NoCorrespondingEntityClassException

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

Exception thrown if an entity type is not represented by a class.

This might occur by calling a static method on an abstract class.

Hierarchy

Expanded class hierarchy of NoCorrespondingEntityClassException

See also

\Drupal\Core\Entity\EntityTypeRepositoryInterface::getEntityTypeFromClass()

2 files declare their use of NoCorrespondingEntityClassException
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/NoCorrespondingEntityClassException.php, line 12

Namespace

Drupal\Core\Entity\Exception
View source
class NoCorrespondingEntityClassException extends \Exception {
    
    /**
     * Constructs a NoCorrespondingEntityClassException.
     *
     * @param string $class
     *   The class which does not correspond to an entity type.
     */
    public function __construct($class) {
        $message = sprintf('The %s class does not correspond to an entity type.', $class);
        parent::__construct($message);
    }

}

Members

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

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