<?php

namespace AutoAdmin\Bundle\Tests\Functional\BrickBuilder\Brick\Handler;

use AutoAdmin\Bundle\BrickBuilder\Brick\Config\Configurator;
use AutoAdmin\Bundle\BrickBuilder\Brick\ConfigSetting\EntitySetting;
use AutoAdmin\Bundle\BrickBuilder\Brick\Handler\AbstractContainerBrickHandler;
use AutoAdmin\Bundle\BrickBuilder\Model\Setting;
use AutoAdmin\Bundle\Tests\Functional\Entity\File;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;

class FileBrickHandler extends AbstractContainerBrickHandler
{
    const BRICK_TYPE = 'brick.file';

    public function configure(Configurator $configurator)
    {
        parent::configure($configurator);

        $configurator->addSetting(
            Setting::new('file')
                ->setType(EntitySetting::class)
                ->setFormType(EntityType::class)
                ->setFormTypeOptions([
                    'class' => File::class,
                ])
        );
    }
}
