| @@ 85-95 (lines=11) @@ | ||
| 82 | }); |
|
| 83 | } |
|
| 84 | ||
| 85 | protected function view($app) |
|
| 86 | { |
|
| 87 | $this->getApp()->appendCommand('order:view', 'Mostra detalhes de um pedido') |
|
| 88 | ->addArgument('orderId', InputArgument::REQUIRED, 'Product ID') |
|
| 89 | ->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
| 90 | $list = $app->processInputParameters([], $input, $output); |
|
| 91 | $id = $input->getArgument('orderId'); |
|
| 92 | $p = $app->factorySdk($list)->factoryManager('order')->findById($id); |
|
| 93 | $app->displayOrder($p, $output); |
|
| 94 | }); |
|
| 95 | } |
|
| 96 | ||
| 97 | protected function factoryList($app, $type) |
|
| 98 | { |
|
| @@ 29-40 (lines=12) @@ | ||
| 26 | { |
|
| 27 | protected $list = ['view', 'insert', 'update', 'list']; |
|
| 28 | ||
| 29 | public function list($app) |
|
| 30 | { |
|
| 31 | $this->getApp()->appendCommand('product:list', 'List') |
|
| 32 | ->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
| 33 | $list = $app->processInputParameters([], $input, $output); |
|
| 34 | $collection = $app->factorySdk($list)->factoryManager('product')->fetch(0, 50); |
|
| 35 | foreach ($collection as $p) { |
|
| 36 | $app->displayProduct($p, $output); |
|
| 37 | $output->writeln("\n\n--------------------------------------\n\n"); |
|
| 38 | } |
|
| 39 | }); |
|
| 40 | } |
|
| 41 | ||
| 42 | public function insert($app) |
|
| 43 | { |
|