eZ\Publish\Core\REST\Client\SectionService::createSection PHP Method

createSection() public method

Creates the a new Section in the content repository.
public createSection ( eZ\Publish\API\Repository\Values\Content\SectionCreateStruct $sectionCreateStruct ) : eZ\Publish\API\Repository\Values\Content\Section
$sectionCreateStruct eZ\Publish\API\Repository\Values\Content\SectionCreateStruct
return eZ\Publish\API\Repository\Values\Content\Section The newly create section
    public function createSection(SectionCreateStruct $sectionCreateStruct)
    {
        $inputMessage = $this->outputVisitor->visit($sectionCreateStruct);
        $inputMessage->headers['Accept'] = $this->outputVisitor->getMediaType('Section');
        $result = $this->client->request('POST', $this->requestParser->generate('sections'), $inputMessage);
        try {
            return $this->inputDispatcher->parse($result);
        } catch (ForbiddenException $e) {
            throw new InvalidArgumentException($e->getMessage(), $e->getCode());
        }
    }