src/Controller/Api/PageController.php
public function postPageSnapshotAction($id)
    {
        $page = $this->getPage($id);

        $this->backend->createAndPublish('sonata.page.create_snapshot', [
            'pageId' => $page->getId(),
        ]);

        return ['queued' => true];
    }
public function postPageSnapshotAction($id)
    {
        $page = $this->getPage($id);

        $this->backend->createAndPublish('sonata.page.create_snapshot', [
            'pageId' => $page->getId(),
        ]);

        return ['queued' => true];
    }
public function postPageSnapshotAction ( $ id ) { $ page = $ this -> getPage ( $ id ) ; $ this -> backend -> createAndPublish ( 'sonata.page.create_snapshot' , [ 'pageId' => $ page -> getId ( ) , ] ) ; return [ 'queued' => true ] ; }
Creates snapshots of a page.

@ApiDoc(
requirements={
{"name"="id", "dataType"="integer", "requirement"="\d+", "description"="page identifier"}
},
statusCodes={
200="Returned when snapshots are successfully queued for creation",
400="Returned when an error has occurred while snapshots creation",
404="Returned when unable to find page"
}
)

@param int $id A Page identifier

@throws NotFoundHttpException

@return \FOS\RestBundle\View\View
Creates snapshots of a page .