Completed
Push — master ( 4ee661...cccce7 )
by Ryuichi
03:25 queued 01:53
created

DelegateException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 47
rs 10
c 0
b 0
f 0
wmc 4
1
<?php
2
namespace WebStream\Exception;
3
4
/**
5
 * ApplicationException
6
 * @author Ryuichi TANAKA.
7
 * @since 2014/05/05
8
 * @version 0.4
9
 */
10
class DelegateException extends ApplicationException
11
{
12
    /**
13
     * @var bool ハンドリング可否
14
     */
15
    private $isHandled;
16
17
    /**
18
     * @var \Exception 例外オブジェクト
19
     */
20
    private $originException;
21
22
    /**
23
     * constructor
24
     * @param \Exception 例外オブジェクト
25
     */
26
    public function __construct(\Exception $originException)
27
    {
28
        parent::__construct($originException->getMessage(), 500, $originException);
29
        $this->originException = $originException;
30
        $this->isHandled = false;
31
    }
32
33
    /**
34
     * オリジナルの例外を返却する
35
     * @return \Exception 例外オブジェクト
36
     */
37
    public function getOriginException()
38
    {
39
        return $this->originException;
40
    }
41
42
    /**
43
     * ハンドリング可否を返却する
44
     * @return bool ハンドリング可否
45
     */
46
    public function isHandled()
47
    {
48
        return $this->isHandled;
49
    }
50
51
    /**
52
     * ハンドリングを許可する
53
     */
54
    public function enableHandled()
55
    {
56
        $this->isHandled = true;
57
    }
58
}
59