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); }
/** * 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'); }
/** * 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'); }