| 1 | <?php |
||
| 12 | abstract class Action implements IAction |
||
| 13 | { |
||
| 14 | protected $args; |
||
| 15 | protected $request; |
||
| 16 | protected $response; |
||
| 17 | |||
| 18 | public function __construct( |
||
| 28 | |||
| 29 | public function execute() |
||
| 30 | { |
||
| 31 | $this->init(); |
||
| 32 | try { |
||
| 33 | $this->performChecks(); |
||
| 34 | $this->performAction(); |
||
| 35 | $this->performCallBack(); |
||
| 36 | } catch (SlimeException $slimeException) { |
||
| 37 | $this->manageSlimeException($slimeException); |
||
| 38 | } catch (\Exception $baseException) { |
||
| 39 | $this->manageBaseException($baseException); |
||
| 40 | } |
||
| 41 | |||
| 42 | $this->formatResponse(); |
||
| 43 | return $this->response; |
||
| 44 | } |
||
| 45 | |||
| 46 | protected abstract function init(); |
||
| 53 | |||
| 54 | |||
| 55 | } |
||
| 56 |