<?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\SimpleEntity;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;

class EntityDefaultBrickHandler extends AbstractContainerBrickHandler
{
    const BRICK_TYPE = 'brick.entity_default';

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

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