Exemplo n.º 1
0
 /**
  * Responds with information about an option
  *
  * @method searchOne
  * @return json/xml data
  */
 public function searchOne($id)
 {
     $results = array();
     $request = $this->di->get('requestBody');
     $parameters = $request->get();
     if (count($parameters) > 1) {
         $option = new OptionsCollection($this->di);
         $results = $this->respond($option, $id);
     } else {
         $results = OptionsCollection::findFirstById($id);
     }
     if (!$results) {
         throw new HTTPException("Not found", 404, array('dev' => 'Option does not exist', 'internalCode' => 'P1000', 'more' => ''));
     }
     return $results;
 }