src/Sulu/Component/Rest/RestController.php
public function responseDelete($id, $deleteCallback)
    {
        try {
            $deleteCallback($id);
            $view = $this->view(null, 204);
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        } catch (RestException $re) {
            $view = $this->view($re->toArray(), 400);
        }

        return $view;
    }
public function responseDelete($id, $deleteCallback)
    {
        try {
            $deleteCallback($id);
            $view = $this->view(null, 204);
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        } catch (RestException $re) {
            $view = $this->view($re->toArray(), 400);
        }

        return $view;
    }
public function responseDelete ( $ id , $ deleteCallback ) { try { $ deleteCallback ( $ id ) ; $ view = $ this -> view ( null , 204 ) ; } catch ( EntityNotFoundException $ enfe ) { $ view = $ this -> view ( $ enfe -> toArray ( ) , 404 ) ; } catch ( RestException $ re ) { $ view = $ this -> view ( $ re -> toArray ( ) , 400 ) ; } return $ view ; }
Deletes the entity with the given id using the deleteCallback and return a successful response, or an error
message with a 4xx status code.

@param $id
@param $deleteCallback

@return \FOS\RestBundle\View\View
Deletes the entity with the given id using the deleteCallback and return a successful response or an error message with a 4xx status code .