/** * @param QueryRequest $qr * @param null $snapshot * @return \Symfony\Component\Finder\SplFileInfo * @throws InstanceNotFoundException * @throws SnapshotException */ public function getSnapshotFile(QueryRequest $qr, $snapshot = null) { try { $this->snapshotManager->init(); $this->snapshotManager->setQueryRequest($qr); if (is_null($snapshot)) { $snapshot = $this->snapshotManager->getFreshSnapshotFileName(); } return $this->snapshotManager->getSnapshotFile($snapshot); } catch (SnapshotException $e) { throw new SnapshotException("Error while fetching the file", $e->getCode(), $e); } catch (NotFoundException $e) { throw new InstanceNotFoundException("Snapshot was not found", 404, $e); } }