summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php
blob: fae821fb812fa61651b1108afb2dcaccc9379ba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

/**
 * @file
 * Contains \Drupal\Core\Entity\Exception\NoCorrespondingEntityClassException.
 */

namespace Drupal\Core\Entity\Exception;

/**
 * Exception thrown if an entity type is not represented by a class.
 *
 * This might occur by calling a static method on an abstract class.
 *
 * @see \Drupal\Core\Entity\Entity::getEntityTypeFromStaticClass()
 */
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);
  }

}