Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $result = $this->actionService->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);
 }
Example #2
0
 /**
  * Returns the DELETE response
  *
  * @param \PSX\Record\RecordInterface $record
  * @return array|\PSX\Record\RecordInterface
  */
 protected function doDelete($record)
 {
     $this->actionService->delete((int) $this->getUriFragment('action_id'));
     return array('success' => true, 'message' => 'Action successful deleted');
 }
Example #3
0
 /**
  * Returns the POST response
  *
  * @param \PSX\Record\RecordInterface $record
  * @return array|\PSX\Record\RecordInterface
  */
 protected function doPost($record)
 {
     $this->actionService->create($record->name, $record->class, $record->config->getProperties());
     return array('success' => true, 'message' => 'Action successful created');
 }