/** * @param string $id * @throws \Piece\Flow\PageFlow\FileNotFoundException */ public function add($id) { if (array_key_exists($id, $this->pageFlows)) { return; } $definitionFile = $this->pageFlowRegistries->getFileName($id); if (is_null($definitionFile)) { throw new FileNotFoundException(sprintf('The page flow definition file for the page flow ID "%s" is not found.', $id)); } $pageFlowCache = new PageFlowCache($definitionFile, $this->cacheDir, $this->clearCacheOnDestruction); if (!$pageFlowCache->isFresh()) { $pageFlowCache->write($this->pageFlowFactory->create($id)); } $this->pageFlows[$id] = $pageFlowCache; }
/** * @return array * @since Method available since Release 2.0.0 */ protected function readDefinition() { $processor = new Processor(); return $processor->processConfiguration(new Definition17Configuration(), array('definition17' => Yaml::parse($this->pageFlowRegistries->getFileName($this->pageFlow->getID())))); }