public function createSection(Request $request)
    {
        try {
            $createdSection = $this->sectionService->createSection(
                $this->inputDispatcher->parse(
                    new Message(
                        array('Content-Type' => $request->headers->get('Content-Type')),
                        $request->getContent()
                    )
                )
            );
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\CreatedSection(
            array(
                'section' => $createdSection,
            )
        );
    }
public function createSection(Request $request)
    {
        try {
            $createdSection = $this->sectionService->createSection(
                $this->inputDispatcher->parse(
                    new Message(
                        array('Content-Type' => $request->headers->get('Content-Type')),
                        $request->getContent()
                    )
                )
            );
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\CreatedSection(
            array(
                'section' => $createdSection,
            )
        );
    }
public function createSection ( Request $ request ) { try { $ createdSection = $ this -> sectionService -> createSection ( $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ) , $ request -> getContent ( ) ) ) ) ; } catch ( InvalidArgumentException $ e ) { throw new ForbiddenException ( $ e -> getMessage ( ) ) ; } return new Values \ CreatedSection ( array ( 'section' => $ createdSection , ) ) ; }
Create new section.

@throws \eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException

@return \eZ\Publish\Core\REST\Server\Values\CreatedSection
Create new section .