summaryrefslogtreecommitdiff
path: root/app/Core/Controller/BaseException.php
blob: 13836d2c8368cbf92f07ed5c93e1ec4eed5a335c (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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;
    }
}