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

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

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

        $metaSet = $metaSetManager->createMetaSet();
        $metaSet
            ->setId(UuidUtil::generate())
            ->setName($name)
            ->setCreateUser($this->getUser()->getDisplayName())
            ->setCreatedAt(new \DateTime())
            ->setModifyUser($this->getUser()->getDisplayName())
            ->setModifiedAt(new \DateTime());

        $metaSetManager->updateMetaSet($metaSet);

        return new ResultResponse(true, "Meta Set {$metaSet->getName()} created.");
    }
public function createAction(Request $request)
    {
        $name = $request->get('name', 'new_set');

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

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

        $metaSet = $metaSetManager->createMetaSet();
        $metaSet
            ->setId(UuidUtil::generate())
            ->setName($name)
            ->setCreateUser($this->getUser()->getDisplayName())
            ->setCreatedAt(new \DateTime())
            ->setModifyUser($this->getUser()->getDisplayName())
            ->setModifiedAt(new \DateTime());

        $metaSetManager->updateMetaSet($metaSet);

        return new ResultResponse(true, "Meta Set {$metaSet->getName()} created.");
    }
public function createAction ( Request $ request ) { $ name = $ request -> get ( 'name' , 'new_set' ) ; $ metaSetManager = $ this -> get ( 'phlexible_meta_set.meta_set_manager' ) ; if ( $ metaSetManager -> findOneByName ( $ name ) ) { return new ResultResponse ( false , 'Name already in use.' ) ; } $ metaSet = $ metaSetManager -> createMetaSet ( ) ; $ metaSet -> setId ( UuidUtil :: generate ( ) ) -> setName ( $ name ) -> setCreateUser ( $ this -> getUser ( ) -> getDisplayName ( ) ) -> setCreatedAt ( new \ DateTime ( ) ) -> setModifyUser ( $ this -> getUser ( ) -> getDisplayName ( ) ) -> setModifiedAt ( new \ DateTime ( ) ) ; $ metaSetManager -> updateMetaSet ( $ metaSet ) ; return new ResultResponse ( true , "Meta Set {$metaSet->getName()} created." ) ; }
Create set.

@param Request $request

@return ResultResponse
@Route("/create", name="metasets_sets_create")
Create set .