You are here

class NoCorrespondingEntityClassException in Drupal 8

Same name and namespace in other branches
  1. 9 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\Entity::getEntityTypeFromStaticClass()

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 an 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

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