<commit_before><?php

namespace Oro\Bundle\LocaleBundle\Form\Type;

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

class LocalizationType extends AbstractType
{
    const NAME = 'oro_localization';

    protected $dataClass = 'Oro\Bundle\LocaleBundle\Entity\Localization';

    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('name')
            ->add('languageCode', 'oro_language_select')
            ->add('formattingCode', 'oro_formatting_select')
            ->add('parentLocalization', 'entity', [
                'class' => 'Oro\Bundle\LocaleBundle\Entity\Localization',
                'required' => false,
            ]);
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => $this->dataClass,
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return static::NAME;
    }

    /**
     * @param string $dataClass
     */
    public function setDataClass($dataClass)
    {
        $this->dataClass = $dataClass;
    }
}<commit_msg>BAP-10618: Create main form type for Localization entity - LocalizationType updated<commit_after><?php

namespace Oro\Bundle\LocaleBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\NotBlank;

class LocalizationType extends AbstractType
{
    const NAME = 'oro_localization';

    protected $dataClass = 'Oro\Bundle\LocaleBundle\Entity\Localization';

    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add(
                'name',
                'text',
                [
                    'required' => true,
                    'label' => 'oro.locale.localization.name.label',
                ]
            )
            ->add(
                'titles',
                LocalizedFallbackValueCollectionType::NAME,
                [
                    'required' => true,
                    'label' => 'oro.locale.localization.titles.label',
                    'options' => ['constraints' => [new NotBlank()]],
                ]
            )
            ->add(
                'languageCode',
                'oro_language_select',
                [
                    'required' => true,
                    'label' => 'oro.locale.localization.language_code.label',
                ]
            )
            ->add(
                'formattingCode',
                'oro_formatting_select',
                [
                    'required' => true,
                    'label' => 'oro.locale.localization.formatting_code.label',
                ])
            ->add(
                'parentLocalization',
                'entity',
                [
                    'class' => 'Oro\Bundle\LocaleBundle\Entity\Localization',
                    'required' => false,
                    'label' => 'oro.locale.localization.parent_localization.label',
                ]
            );
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => $this->dataClass,
            'intention' => 'localization',
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return static::NAME;
    }

    /**
     * @param string $dataClass
     */
    public function setDataClass($dataClass)
    {
        $this->dataClass = $dataClass;
    }
}
{'fraction_non_alphanumeric': 0.1225071225071225, 'fraction_numerical': 0.001295001295001295, 'mean_word_length': 1.6616126809097174, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '529213', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1008, 'n_words': 162}