src/Controller/Api/PageController.php
public function postPagesSnapshotsAction()
    {
        $sites = $this->siteManager->findAll();

        foreach ($sites as $site) {
            $this->backend->createAndPublish('sonata.page.create_snapshot', [
                'siteId' => $site->getId(),
            ]);
        }

        return ['queued' => true];
    }
public function postPagesSnapshotsAction()
    {
        $sites = $this->siteManager->findAll();

        foreach ($sites as $site) {
            $this->backend->createAndPublish('sonata.page.create_snapshot', [
                'siteId' => $site->getId(),
            ]);
        }

        return ['queued' => true];
    }
public function postPagesSnapshotsAction ( ) { $ sites = $ this -> siteManager -> findAll ( ) ; foreach ( $ sites as $ site ) { $ this -> backend -> createAndPublish ( 'sonata.page.create_snapshot' , [ 'siteId' => $ site -> getId ( ) , ] ) ; } return [ 'queued' => true ] ; }
Creates snapshots of all pages.

@ApiDoc(
statusCodes={
200="Returned when snapshots are successfully queued for creation",
400="Returned when an error has occurred while snapshots creation",
}
)

@throws NotFoundHttpException

@return \FOS\RestBundle\View\View
Creates snapshots of all pages .