QuestionQ10

Adobe Commerce Architecture and Customization Techniques

An Adobe Commerce developer has built a process that exports a specified order to an external accounting system. The process must be launched through the Magento CLI with:

php bin/magento my_module:order:process --order_id=<order_id>

Example: php bin/magento my_module:order:process --order_id=1245.

How should the command be configured?

  • A
  • B
  • C
Explanation

A --order_id=<order_id> input is a named command option, so it must be declared with addOption('order_id', null, InputOption::VALUE_REQUIRED, ...). Symfony Console uses VALUE_REQUIRED for an option value such as --iterations=5; addArgument() instead defines an ordered positional value without the --order_id name.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!