<?php

namespace Madrasse\AdminBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
 * Class ClassSchoolType
 * @package Madrasse\AdminBundle\Form
 */
class ClassSchoolType extends AbstractType
{

    /**
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name', 'text', ['label' => 'Nom'])
            ->add('ageMinimum', 'integer', ['label' => 'Age minimum'])
            ->add('ageMaximum', 'integer', ['label' => 'Age maximum'])
            ->add('professors', 'text', ['label' => 'Liste professeurs'])
            ->add('description', 'textarea', ['label' => 'Description', 'required' => false])
            ->add('status', 'checkbox', ['label' => 'Etat', 'required' => false]);
    }

    /**
     * @param OptionsResolver $resolver
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class'         => 'Madrasse\AdminBundle\Entity\ClassSchool',
            'translation_domain' => 'class_school',
        ]);
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'madrasse_adminbundle_classschool';
    }

}
