NoCorrespondingEntityClassException.php 661 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Drupal\Core\Entity\Exception;
  3. /**
  4. * Exception thrown if an entity type is not represented by a class.
  5. *
  6. * This might occur by calling a static method on an abstract class.
  7. *
  8. * @see \Drupal\Core\Entity\Entity::getEntityTypeFromStaticClass()
  9. */
  10. class NoCorrespondingEntityClassException extends \Exception {
  11. /**
  12. * Constructs an NoCorrespondingEntityClassException.
  13. *
  14. * @param string $class
  15. * The class which does not correspond to an entity type.
  16. */
  17. public function __construct($class) {
  18. $message = sprintf('The %s class does not correspond to an entity type.', $class);
  19. parent::__construct($message);
  20. }
  21. }