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\SovBundle\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 SiteSettingInitCommand extends Command
  9. {
  10. protected static $defaultName = 'setting:site:init';
  11. protected static $defaultDescription = 'Initialise les SiteSetting.';
  12. protected SettingBuilder $settingBuilder;
  13. public function __construct(SettingBuilder $settingBuilder, string $name = null)
  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->initSiteSettings();
  25. $this->io->success('Les SiteSetting ont bien été initialisées.');
  26. return Command::SUCCESS;
  27. }
  28. }