original_string: public function delete(Resource $resource)
      {
          $data = $resource->toArray();
  
          $client = $this->getRepository()->findOneBy(array('id' => $data['id']));
          if (!$client) {
              $errorMessage = $this->translator->trans('error.client_not_found', array('%id%' => $data['id']));
              throw new NotFoundHttpException($errorMessage);
          }
  
          $this->entityManager->remove($client);
      }
code: public function delete(Resource $resource)
      {
          $data = $resource->toArray();
  
          $client = $this->getRepository()->findOneBy(array('id' => $data['id']));
          if (!$client) {
              $errorMessage = $this->translator->trans('error.client_not_found', array('%id%' => $data['id']));
              throw new NotFoundHttpException($errorMessage);
          }
  
          $this->entityManager->remove($client);
      }
code_tokens: public function delete ( Resource $ resource ) { $ data = $ resource -> toArray ( ) ; $ client = $ this -> getRepository ( ) -> findOneBy ( array ( 'id' => $ data [ 'id' ] ) ) ; if ( ! $ client ) { $ errorMessage = $ this -> translator -> trans ( 'error.client_not_found' , array ( '%id%' => $ data [ 'id' ] ) ) ; throw new NotFoundHttpException ( $ errorMessage ) ; } $ this -> entityManager -> remove ( $ client ) ; }
docstring: Removes the Client from the database.
  
  @param \Hal\Resource $resource
  
  @throws NotFoundHttpException if no client with the given id could be found.
  
  @return void
docstring_tokens: Removes the Client from the database .