<?php

/*
 * This file is part of the FOSUserBundle package.
 *
 * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace AppBundle\Form;

use AppBundle\Entity\User;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CountryType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\UrlType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;

class LanguageType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nameLanguage', TextType::class, array(
                'label' => 'talent.profile.language.name.label',
            ))
            ->add('skillLanguage', ChoiceType::class, array(
                'label' => 'talent.profile.language.skill.label',
                'choices' => $this->getSkills(),
                'placeholder' => 'Niveau',
                'required' => true
            ));
    }

    private function getSkills()
    {   
        $skills = array(
            'talent.profile.language.skill.1.label' => 'talent.profile.language.skill.1.label',
            'talent.profile.language.skill.2.label' =>'talent.profile.language.skill.2.label',
            'talent.profile.language.skill.3.label' => 'talent.profile.language.skill.3.label',
            'talent.profile.language.skill.4.label' => 'talent.profile.language.skill.4.label',
        );
         
         return $skills;
    }

    public function getName()
    {
        return 'language';
    }
}
