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);
    }
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);
    }
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 ) ; }
Removes the Client from the database.

@param \Hal\Resource $resource

@throws NotFoundHttpException if no client with the given id could be found.

@return void
Removes the Client from the database .