Файл: symfony-2.7/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php
Строк: 63
<?php
/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace SymfonyBridgePropel1FormType;
use SymfonyComponentFormAbstractType;
use SymfonyComponentFormFormBuilderInterface;
use SymfonyComponentOptionsResolverOptionsResolver;
use SymfonyBridgePropel1FormEventListenerTranslationFormListener;
/**
 * Translation type class.
 *
 * @author Patrick Kaufmann
 */
class TranslationType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->addEventSubscriber(
            new TranslationFormListener($options['columns'], $options['data_class'])
        );
    }
    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'propel1_translation';
    }
    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(array(
            'data_class',
            'columns',
        ));
    }
}