/**
  * {@inheritdoc}
  */
 public function process(ConsumerEvent $event)
 {
     $pageId = $event->getMessage()->getValue('pageId');
     $page = $this->pageManager->findOneBy(array('id' => $pageId));
     if (!$page) {
         return;
     }
     // start a transaction
     $this->snapshotManager->getConnection()->beginTransaction();
     // creating snapshot
     $snapshot = $this->transformer->create($page);
     // update the page status
     $page->setEdited(false);
     $this->pageManager->save($page);
     // save the snapshot
     $this->snapshotManager->save($snapshot);
     $this->snapshotManager->enableSnapshots(array($snapshot));
     // commit the changes
     $this->snapshotManager->getConnection()->commit();
 }