<?php

namespace Site\FrontendBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityRepository;
use Site\FrontendBundle\Form\Extension;


class EventType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('titleEng', 'text')
            ->add('organiser', 'text')
            ->add('date', 'text')
            ->add('place', 'text')
            ->add('link', 'text', array(
                    'required' => false)
            )
            ->add('description', 'textarea')
        ;

        if ($builder->getData()->getId()) { // or !getId()
            $builder->add('delete', 'checkbox'); // or whatever
        }
    }
    public function getName()
    {
        return 'site_frontendbundle_eventtype';
    }
}
?>