src/Ingewikkeld/Rest/UserBundle/ResourceMapper/User.php
public function delete(Resource $resource)
    {
        $data = $resource->toArray();

        $user = $this->userManager->findUserByUsername($data['username']);
        if (!$user) {
            $errorMessage = $this->translator->trans('error.user_not_found', array('%username%' => $data['username']));
            throw new NotFoundHttpException($errorMessage);
        }

        $this->userManager->deleteUser($user);
    }
public function delete(Resource $resource)
    {
        $data = $resource->toArray();

        $user = $this->userManager->findUserByUsername($data['username']);
        if (!$user) {
            $errorMessage = $this->translator->trans('error.user_not_found', array('%username%' => $data['username']));
            throw new NotFoundHttpException($errorMessage);
        }

        $this->userManager->deleteUser($user);
    }
public function delete ( Resource $ resource ) { $ data = $ resource -> toArray ( ) ; $ user = $ this -> userManager -> findUserByUsername ( $ data [ 'username' ] ) ; if ( ! $ user ) { $ errorMessage = $ this -> translator -> trans ( 'error.user_not_found' , array ( '%username%' => $ data [ 'username' ] ) ) ; throw new NotFoundHttpException ( $ errorMessage ) ; } $ this -> userManager -> deleteUser ( $ user ) ; }
Removes the User from the database.

@param \Hal\Resource $resource

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

@return void
Removes the User from the database .