public function __construct() { parent::__construct(); $tzName = $this->getRequestParameter('timeZone') === null ? \common_session_SessionManager::getSession()->getTimeZone() : $this->getRequestParameter('timeZone'); $this->tz = new \DateTimeZone($tzName); $this->scheduleService = DeliveryScheduleService::singleton(); $this->service = DeliveryAssemblyService::singleton(); switch ($this->getRequestMethod()) { case "GET": $this->action = 'get'; break; case "PUT": $this->action = 'update'; break; case "POST": $this->action = 'create'; break; case "DELETE": $this->action = 'deleteDelivery'; break; default: $this->sendData(array('message' => 'Not found'), 404); exit; } }
public function __construct() { parent::__construct(); $this->scheduleService = DeliveryScheduleService::singleton(); $this->testTakersService = DeliveryTestTakersService::singleton(); switch ($this->getRequestMethod()) { case "GET": $this->action = 'get'; break; case "PUT": $this->action = 'update'; break; case "POST": $this->action = 'create'; break; case "DELETE": $this->sendData(array('message' => 'Method is not implemented'), 501); exit; default: $this->sendData(array('message' => 'Not found'), 404); exit; } }