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