/**
  * Check if the current HTTP method is allowed for the resource being accesed
  *
  * @see \Slim\Middleware::call()
  */
 public function call()
 {
     $params = $this->app->router()->getCurrentRoute()->getParams();
     $options = $this->model->getOptionsList();
     if (isset($params['id'])) {
         $options = $this->model->getOptions();
     }
     if (in_array($this->app->request()->getMethod(), $options)) {
         $this->next->call();
         return;
     }
     $this->app->response()->setStatus(405);
     // Method Not Allowed
 }
 /**
  * @return void
  */
 public function options()
 {
     $this->response->headers->set('Allow', implode(',', $this->model->getOptions()));
 }