diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-15 18:31:47 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-15 18:31:47 -0400 |
commit | 67b836164997527b91452b19adbcb8aa3c5decf1 (patch) | |
tree | b5876d311912e97b0592c7e208639f7b52813a75 /app/Core/Controller/BaseException.php | |
parent | 108e867605dbc7ece4cbcbecc89a674e9c154a9b (diff) |
Refactoring: added controlled middleware and changed response class
Diffstat (limited to 'app/Core/Controller/BaseException.php')
-rw-r--r-- | app/Core/Controller/BaseException.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/app/Core/Controller/BaseException.php b/app/Core/Controller/BaseException.php new file mode 100644 index 00000000..13836d2c --- /dev/null +++ b/app/Core/Controller/BaseException.php @@ -0,0 +1,52 @@ +<?php + +namespace Kanboard\Core\Controller; + +use Exception; + +/** + * Class AccessForbiddenException + * + * @package Kanboard\Core\Controller + * @author Frederic Guillot + */ +class BaseException extends Exception +{ + protected $withoutLayout = false; + + /** + * Get object instance + * + * @static + * @access public + * @param string $message + * @return static + */ + public static function getInstance($message = '') + { + return new static($message); + } + + /** + * There is no layout + * + * @access public + * @return BaseException + */ + public function withoutLayout() + { + $this->withoutLayout = true; + return $this; + } + + /** + * Return true if no layout + * + * @access public + * @return boolean + */ + public function hasLayout() + { + return $this->withoutLayout; + } +} |