@@ -27,6 +27,7 @@ class ImportCmsData extends \Symfony\Component\Console\Command\Command
2727 private const INPUT_KEY_TYPE = 'type ' ;
2828 private const INPUT_TYPE_VALUES = ['block ' , 'page ' , 'all ' ];
2929 private const INPUT_KEY_IDENTIFIER = 'identifier ' ;
30+ private const INPUT_KEY_IMPORT_ALL = 'importAll ' ;
3031 private \RocketWeb \CmsImportExport \Model \Service \ImportCmsDataService $ importCmsDataService ;
3132
3233 public function __construct (
@@ -53,6 +54,12 @@ protected function configure()
5354 'i ' ,
5455 InputOption::VALUE_OPTIONAL ,
5556 'identifier to process (one or CSV list) '
57+ ),
58+ new InputOption (
59+ self ::INPUT_KEY_IMPORT_ALL ,
60+ 'a ' ,
61+ InputOption::VALUE_NONE ,
62+ 'Flag to import all files '
5663 )
5764 ]);
5865 parent ::configure ();
@@ -61,6 +68,7 @@ protected function configure()
6168 protected function execute (InputInterface $ input , OutputInterface $ output ): void
6269 {
6370 $ type = $ input ->getOption (self ::INPUT_KEY_TYPE );
71+ $ importAll = (bool )$ input ->getOption (self ::INPUT_KEY_IMPORT_ALL );
6472 if ($ type === null ) {
6573 throw new \RuntimeException ("Type ([-t|--type) is required " );
6674 }
@@ -80,6 +88,6 @@ protected function execute(InputInterface $input, OutputInterface $output): void
8088 $ identifiers = explode (', ' , $ identifiers );
8189 }
8290
83- $ this ->importCmsDataService ->execute ($ types , $ identifiers );
91+ $ this ->importCmsDataService ->execute ($ types , $ identifiers, $ importAll );
8492 }
8593}
0 commit comments