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

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

Assigns the content to the given section this method overrides the current assigned section.
public assignSection ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo, eZ\Publish\API\Repository\Values\Content\Section $section )
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo
$section eZ\Publish\API\Repository\Values\Content\Section
    public function assignSection(ContentInfo $contentInfo, Section $section)
    {
        $inputMessage = $this->outputVisitor->visit(new RestContentMetadataUpdateStruct(array('sectionId' => $section->id)));
        $inputMessage->headers['Accept'] = $this->outputVisitor->getMediaType('Content');
        $inputMessage->headers['X-HTTP-Method-Override'] = 'PATCH';
        $this->client->request('POST', $contentInfo->id, $inputMessage);
        // Will throw exception on error, no return value for method
        // @todo: Deactivated due to missing implementation of visitor for
        // content on the server side.
        // Should be: $result = $this->inputDispatcher->parse( $response );
    }