src/Sulu/Bundle/MediaBundle/Controller/MediaController.php
protected function moveEntity($id, Request $request)
    {
        try {
            $locale = $this->getRequestParameter($request, 'locale', true);
            $destination = $this->getRequestParameter($request, 'destination', true);
            $mediaManager = $this->getMediaManager();

            $media = $mediaManager->move(
                $id,
                $locale,
                $destination
            );

            $view = $this->view($media, 200);
        } catch (MediaNotFoundException $e) {
            $view = $this->view($e->toArray(), 404);
        } catch (MediaException $e) {
            $view = $this->view($e->toArray(), 400);
        }

        return $this->handleView($view);
    }
protected function moveEntity($id, Request $request)
    {
        try {
            $locale = $this->getRequestParameter($request, 'locale', true);
            $destination = $this->getRequestParameter($request, 'destination', true);
            $mediaManager = $this->getMediaManager();

            $media = $mediaManager->move(
                $id,
                $locale,
                $destination
            );

            $view = $this->view($media, 200);
        } catch (MediaNotFoundException $e) {
            $view = $this->view($e->toArray(), 404);
        } catch (MediaException $e) {
            $view = $this->view($e->toArray(), 400);
        }

        return $this->handleView($view);
    }
protected function moveEntity ( $ id , Request $ request ) { try { $ locale = $ this -> getRequestParameter ( $ request , 'locale' , true ) ; $ destination = $ this -> getRequestParameter ( $ request , 'destination' , true ) ; $ mediaManager = $ this -> getMediaManager ( ) ; $ media = $ mediaManager -> move ( $ id , $ locale , $ destination ) ; $ view = $ this -> view ( $ media , 200 ) ; } catch ( MediaNotFoundException $ e ) { $ view = $ this -> view ( $ e -> toArray ( ) , 404 ) ; } catch ( MediaException $ e ) { $ view = $ this -> view ( $ e -> toArray ( ) , 400 ) ; } return $ this -> handleView ( $ view ) ; }
Move an entity to another collection.

@param int $id
@param Request $request

@return Response
Move an entity to another collection .