Ejemplo n.º 1
0
 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');
     }
 }
Ejemplo n.º 2
0
 protected function getSchemaCache($schemaId)
 {
     $schema = $this->schemaTable->get($schemaId);
     return $schema['cache'];
 }