<?php

namespace Lc\SovBundle\Command;

use Lc\SovBundle\Builder\Setting\SettingBuilder;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

class SiteSettingInitCommand extends Command
{
    protected static $defaultName = 'setting:site:init';
    protected static $defaultDescription = 'Initialise les SiteSetting.';

    protected SettingBuilder $settingBuilder;

    public function __construct(SettingBuilder $settingBuilder, string $name = null)
    {
        parent::__construct($name);
        $this->settingBuilder = $settingBuilder;
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->io = new SymfonyStyle($input, $output);
        $this->settingBuilder->initSiteSettings();
        $this->io->success('Les SiteSetting ont bien été initialisées.');
        return Command::SUCCESS;
    }
}
