public function put($id)
 {
     $id = (int) $id;
     if (empty($id)) {
         $response = new Response($this->response);
         return $response->badRequest('Invalid parameter.');
     }
     $entity = $this->_entity->getRepository()->find($id);
     if (empty($entity)) {
         $response = new Response($this->response);
         return $response->notFound();
     }
     $data = $this->request->getBodyParameters();
     try {
         $entity->setProperties($data);
         $this->_em->persist($entity);
         $this->_em->flush();
     } catch (\Exception $e) {
         $response = new Response($this->response);
         return $response->internalServerError();
     }
     $this->result = new ResultToArray($entity);
     return $this->getResult();
 }