summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php')
-rw-r--r--core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php b/core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php
new file mode 100644
index 0000000..fae821f
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/Exception/NoCorrespondingEntityClassException.php
@@ -0,0 +1,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);
+ }
+
+}