You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Command;
  3. use Lc\SovBundle\Builder\Setting\SettingBuilder;
  4. use Symfony\Component\Console\Command\Command;
  5. use Symfony\Component\Console\Input\InputInterface;
  6. use Symfony\Component\Console\Output\OutputInterface;
  7. use Symfony\Component\Console\Style\SymfonyStyle;
  8. class SectionSettingInitCommand extends Command
  9. {
  10. protected static $defaultName = 'setting:section:init';
  11. protected static $defaultDescription = 'Initialise les SectionSetting.';
  12. protected SettingBuilder $settingBuilder;
  13. public function __construct(string $name = null, SettingBuilder $settingBuilder)
  14. {
  15. parent::__construct($name);
  16. $this->settingBuilder = $settingBuilder;
  17. }
  18. /**
  19. * {@inheritdoc}
  20. */
  21. protected function execute(InputInterface $input, OutputInterface $output)
  22. {
  23. $this->io = new SymfonyStyle($input, $output);
  24. $this->settingBuilder->initSectionSettings();
  25. $this->io->success('Les SectionSetting ont bien été initialisées.');
  26. return Command::SUCCESS;
  27. }
  28. }