1 | <?php |
||
13 | class Recorder extends Component{ |
||
14 | |||
15 | /** |
||
16 | * @var mixed |
||
17 | */ |
||
18 | protected $config = []; |
||
19 | |||
20 | /** |
||
21 | * The constructor |
||
22 | */ |
||
23 | 27 | public function __construct() { |
|
26 | |||
27 | /** |
||
28 | * Records an Exception to the database |
||
29 | * @param Exception $e The exception you want to record |
||
30 | * @return ExceptionModel|false |
||
31 | */ |
||
32 | 6 | public function record(Exception $e) |
|
62 | |||
63 | /** |
||
64 | * Checks the config to see if you can collect certain information |
||
65 | * @param string $type the config value you want to check |
||
66 | * @return boolean |
||
67 | */ |
||
68 | 6 | private function canCollect($type) { |
|
74 | |||
75 | /** |
||
76 | * @param string $key |
||
77 | */ |
||
78 | 3 | protected function collect($key,Exception $e = null){ |
|
96 | |||
97 | /** |
||
98 | * Gets the ID of the User that is logged in |
||
99 | * @return integer|null The ID of the User or Null if not logged in |
||
100 | */ |
||
101 | 3 | protected function getUserId() { |
|
109 | |||
110 | /** |
||
111 | * Gets the Method of the Request |
||
112 | * @return string|null Possible values are null or GET, POST, DELETE, PUT, etc... |
||
113 | */ |
||
114 | 3 | protected function getMethod() { |
|
122 | |||
123 | /** |
||
124 | * Gets the input data of the Request |
||
125 | * @return array|null The Input data or null |
||
126 | */ |
||
127 | 3 | protected function getData() { |
|
135 | |||
136 | /** |
||
137 | * Gets the URL of the Request |
||
138 | * @return string|null Returns a URL string or null |
||
139 | */ |
||
140 | 3 | protected function getUrl() { |
|
148 | |||
149 | /** |
||
150 | * Gets the status code of the Exception |
||
151 | * @param Exception $e The Exception to check |
||
152 | * @return string|integer The status code value |
||
153 | */ |
||
154 | 3 | protected function getStatusCode(Exception $e) { |
|
161 | } |