<?php
namespace Cms\Modules\AlertBundle\Form\Type;
use Cms\Modules\AlertBundle\Model\Alert\AlertData;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Class AlertTypeType
* @package Cms\Modules\AlertBundle\Form\Type
*/
final class AlertLevelType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function getParent(): ?string
{
return ChoiceType::class;
}
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'expanded' => true,
'multiple' => false,
'empty_data' => AlertData::LEVELS__INFORMATIVE,
'choices' => [
'Informative' => AlertData::LEVELS__INFORMATIVE,
'Important' => AlertData::LEVELS__IMPORTANT,
'Urgent' => AlertData::LEVELS__URGENT,
],
]);
}
}