Version 1
[yaffs-website] / web / modules / contrib / media_entity / src / MediaTypeException.php
1 <?php
2
3 namespace Drupal\media_entity;
4
5 /**
6  * Generic Plugin exception class to be thrown when no more specific class
7  * is applicable.
8  */
9 class MediaTypeException extends \Exception {
10
11   /**
12    * Form element name that this exception belongs to.
13    *
14    * @var string
15    */
16   protected $element;
17
18   /**
19    * Construct the exception.
20    *
21    * @param string $element
22    *   [optional] Name of form element that exception refers to.
23    * @param string $message
24    *   [optional] The Exception message to throw.
25    * @param int $code
26    *   [optional] The Exception code.
27    * @param \Exception $previous
28    *   [optional] The previous exception used for the exception chaining.
29    */
30   public function __construct($element = NULL, $message = "", $code = 0, \Exception $previous = NULL) {
31     parent::__construct($message, $code, $previous);
32     $this->element = $element;
33   }
34
35   /**
36    * Gets element.
37    *
38    * @return string
39    *   Element name.
40    */
41   public function getElement() {
42     return $this->element;
43   }
44
45 }