| @@ 141-152 (lines=12) @@ | ||
| 138 | }); |
|
| 139 | } |
|
| 140 | ||
| 141 | public function status($app) |
|
| 142 | { |
|
| 143 | $this->getApp()->appendCommand('product:status', 'Consulta o status de um produto') |
|
| 144 | ->addArgument('productId', InputArgument::REQUIRED, 'Product ID') |
|
| 145 | ->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
| 146 | $list = $app->processInputParameters([], $input, $output); |
|
| 147 | $id = $input->getArgument('productId'); |
|
| 148 | $output->writeln('Status do Product #<info>'.$id.'</info>'); |
|
| 149 | $status = $app->factorySdk($list)->factoryManager('product')->fetchStatusById($id); |
|
| 150 | $app->displayTableResults($output, [$status->toLog()]); |
|
| 151 | }); |
|
| 152 | } |
|
| 153 | ||
| 154 | public function update($app) |
|
| 155 | { |
|
| @@ 28-42 (lines=15) @@ | ||
| 25 | { |
|
| 26 | protected $list = ['view', 'details', 'update']; |
|
| 27 | ||
| 28 | public function view($app) |
|
| 29 | { |
|
| 30 | $this->getApp()->appendCommand('product:sku:view', 'Mostra os SKUs de um Produto') |
|
| 31 | ->addArgument('productId', InputArgument::REQUIRED, 'Product ID') |
|
| 32 | ->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
| 33 | $list = $app->processInputParameters([], $input, $output); |
|
| 34 | $id = $input->getArgument('productId'); |
|
| 35 | $output->writeln('Exibindo informações do SKU #<info>'.$id.'</info>'); |
|
| 36 | $p = $app->factorySdk($list)->factoryManager('sku')->findById($id); |
|
| 37 | if (empty($p)) { |
|
| 38 | return $output->writeln('<error>Sku não encontrado!</error>'); |
|
| 39 | } |
|
| 40 | $app->displayTableResults($output, [$p]); |
|
| 41 | }); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function details($app) |
|
| 45 | { |
|