eZ\Publish\Core\REST\Client\SectionService::updateSection PHP Метод

updateSection() публичный Метод

Updates the given in the content repository.
public updateSection ( eZ\Publish\API\Repository\Values\Content\Section $section, eZ\Publish\API\Repository\Values\Content\SectionUpdateStruct $sectionUpdateStruct ) : eZ\Publish\API\Repository\Values\Content\Section
$section eZ\Publish\API\Repository\Values\Content\Section
$sectionUpdateStruct eZ\Publish\API\Repository\Values\Content\SectionUpdateStruct
Результат eZ\Publish\API\Repository\Values\Content\Section
    public function updateSection(Section $section, SectionUpdateStruct $sectionUpdateStruct)
    {
        $inputMessage = $this->outputVisitor->visit($sectionUpdateStruct);
        $inputMessage->headers['Accept'] = $this->outputVisitor->getMediaType('Section');
        $inputMessage->headers['X-HTTP-Method-Override'] = 'PATCH';
        // Should originally be PATCH, but PHP's shiny new internal web server
        // dies with it.
        $result = $this->client->request('POST', $section->id, $inputMessage);
        try {
            return $this->inputDispatcher->parse($result);
        } catch (ForbiddenException $e) {
            throw new InvalidArgumentException($e->getMessage(), $e->getCode());
        }
    }