Pimcore\Controller\Action\Admin\Document::changeMasterDocumentAction PHP Метод

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

this is used for pages and snippets to change the master document (which is not saved with the normal save button)
    public function changeMasterDocumentAction()
    {
        $doc = Model\Document::getById($this->getParam("id"));
        if ($doc instanceof Model\Document\PageSnippet) {
            $doc->setElements([]);
            $doc->setContentMasterDocumentId($this->getParam("contentMasterDocumentPath"));
            $doc->saveVersion();
        }
        $this->_helper->json(["success" => true]);
    }