deblan.tv/vendor/trinity/src/Trinity/.svn/pristine/b1/b1be46c87aa3c3f3f3bf7d914f012888be227d01.svn-base
2015-03-02 21:57:49 +01:00

44 lines
905 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace Trinity\Bundle\MediaBundle\Form\Type;
use Propel\PropelBundle\Form\BaseAbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Trinity\Component\Form\EventListener\FileDeleteFormListener;
class TypeType extends BaseAbstractType
{
protected $options = array(
'data_class' => 'Trinity\Bundle\MediaBundle\Model\Type',
'name' => 'type',
);
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('label');
$builder->add(
'icon',
'file',
array(
'data_class' => null,
)
);
$builder->add(
'thumbnail',
'file',
array(
'data_class' => null,
)
);
$builder->add('mimes');
$builder->addEventSubscriber(new FileDeleteFormListener($builder->getFormFactory(), array('icon', 'thumbnail')));
}
}