<?php
 namespace App\Utils\Webservice\Rest; abstract class ResponseAbstract { public $status = 'ok'; public $message; public $errorCode; public function setErrorMessage($errorMessage, $errorCode=null) { $this->status = 'error'; $this->message = $errorMessage; $this->errorCode = $errorCode; } public function applyRuntimeException(\Exception $e) { $this->setErrorMessage($e->getMessage(), $e->getCode()?:null); } }