public function getHtmlPreview($schemaId) { $schema = $this->schemaTable->get($schemaId); if (!empty($schema)) { $generator = new Generator\Html(); $schema = unserialize($schema['cache']); if ($schema instanceof SchemaInterface) { return $generator->generate($schema); } else { throw new RuntimeException('Invalid schema'); } } else { throw new StatusCode\NotFoundException('Invalid schema id'); } }
protected function getSchemaCache($schemaId) { $schema = $this->schemaTable->get($schemaId); return $schema['cache']; }