src/Phlexible/Bundle/SiterootBundle/Controller/SiterootController.php
public function createAction(Request $request)
    {
        $title = $request->get('title', null);

        $siterootManager = $this->get('phlexible_siteroot.siteroot_manager');

        $siteroot = new Siteroot();
        foreach (explode(',', $this->container->getParameter('phlexible_gui.languages.available')) as $language) {
            $siteroot->setTitle($language, $title);
        }
        $siteroot
            ->setCreateUserId($this->getUser()->getId())
            ->setCreatedAt(new \DateTime())
            ->setModifyUserId($siteroot->getCreateUserId())
            ->setModifiedAt($siteroot->getCreatedAt());

        $siterootManager->updateSiteroot($siteroot);

        return new ResultResponse(true, 'New Siteroot created.');
    }
public function createAction(Request $request)
    {
        $title = $request->get('title', null);

        $siterootManager = $this->get('phlexible_siteroot.siteroot_manager');

        $siteroot = new Siteroot();
        foreach (explode(',', $this->container->getParameter('phlexible_gui.languages.available')) as $language) {
            $siteroot->setTitle($language, $title);
        }
        $siteroot
            ->setCreateUserId($this->getUser()->getId())
            ->setCreatedAt(new \DateTime())
            ->setModifyUserId($siteroot->getCreateUserId())
            ->setModifiedAt($siteroot->getCreatedAt());

        $siterootManager->updateSiteroot($siteroot);

        return new ResultResponse(true, 'New Siteroot created.');
    }
public function createAction ( Request $ request ) { $ title = $ request -> get ( 'title' , null ) ; $ siterootManager = $ this -> get ( 'phlexible_siteroot.siteroot_manager' ) ; $ siteroot = new Siteroot ( ) ; foreach ( explode ( ',' , $ this -> container -> getParameter ( 'phlexible_gui.languages.available' ) ) as $ language ) { $ siteroot -> setTitle ( $ language , $ title ) ; } $ siteroot -> setCreateUserId ( $ this -> getUser ( ) -> getId ( ) ) -> setCreatedAt ( new \ DateTime ( ) ) -> setModifyUserId ( $ siteroot -> getCreateUserId ( ) ) -> setModifiedAt ( $ siteroot -> getCreatedAt ( ) ) ; $ siterootManager -> updateSiteroot ( $ siteroot ) ; return new ResultResponse ( true , 'New Siteroot created.' ) ; }
Create siteroot.

@param Request $request

@return ResultResponse
@Route("/create", name="siteroots_siteroot_create")
Create siteroot .