Exemplo n.º 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $result = $this->schemaService->getAll($input->getOption('startIndex'), $input->getArgument('search'));
     $rows = [];
     foreach ($result->entry as $row) {
         $rows[] = [$row->id, $row->name];
     }
     $table = new Table($output);
     $table->setHeaders(['ID', 'Name'])->setRows($rows);
     $table->render($output);
 }
Exemplo n.º 2
0
 /**
  * Returns the DELETE response
  *
  * @param \PSX\Record\RecordInterface $record
  * @return array|\PSX\Record\RecordInterface
  */
 protected function doDelete($record)
 {
     $this->schemaService->delete((int) $this->getUriFragment('schema_id'));
     return array('success' => true, 'message' => 'Schema successful deleted');
 }
Exemplo n.º 3
0
 /**
  * Returns the POST response
  *
  * @param \PSX\Record\RecordInterface $record
  * @return array|\PSX\Record\RecordInterface
  */
 protected function doPost($record)
 {
     $this->schemaService->create($record->name, $record->source);
     return array('success' => true, 'message' => 'Schema successful created');
 }
Exemplo n.º 4
0
 /**
  * Returns the POST response
  *
  * @param \PSX\Record\RecordInterface $record
  * @return array|\PSX\Record\RecordInterface
  */
 protected function doPost($record)
 {
     $body = $this->schemaService->getHtmlPreview((int) $this->getUriFragment('schema_id'));
     $this->setBody(['preview' => $body]);
 }