src/Phlexible/Bundle/MetaSetBundle/Controller/SetsController.php
public function renameAction(Request $request)
    {
        $id = $request->get('id');
        $name = $request->get('name');

        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');

        if ($metaSetManager->findOneByName($name)) {
            return new ResultResponse(false, 'Name already in use.');
        }

        $metaSet = $metaSetManager->find($id);
        $oldName = $metaSet->getName();

        $metaSet->setName($name);
        $metaSetManager->updateMetaSet($metaSet);

        return new ResultResponse(true, "Meta Set $oldName renamed to $name.");
    }
public function renameAction(Request $request)
    {
        $id = $request->get('id');
        $name = $request->get('name');

        $metaSetManager = $this->get('phlexible_meta_set.meta_set_manager');

        if ($metaSetManager->findOneByName($name)) {
            return new ResultResponse(false, 'Name already in use.');
        }

        $metaSet = $metaSetManager->find($id);
        $oldName = $metaSet->getName();

        $metaSet->setName($name);
        $metaSetManager->updateMetaSet($metaSet);

        return new ResultResponse(true, "Meta Set $oldName renamed to $name.");
    }
public function renameAction ( Request $ request ) { $ id = $ request -> get ( 'id' ) ; $ name = $ request -> get ( 'name' ) ; $ metaSetManager = $ this -> get ( 'phlexible_meta_set.meta_set_manager' ) ; if ( $ metaSetManager -> findOneByName ( $ name ) ) { return new ResultResponse ( false , 'Name already in use.' ) ; } $ metaSet = $ metaSetManager -> find ( $ id ) ; $ oldName = $ metaSet -> getName ( ) ; $ metaSet -> setName ( $ name ) ; $ metaSetManager -> updateMetaSet ( $ metaSet ) ; return new ResultResponse ( true , "Meta Set $oldName renamed to $name." ) ; }
Rename set.

@param Request $request

@return ResultResponse
@Route("/rename", name="metasets_sets_rename")
Rename set .