<?php
namespace FMT\Application\FormType\Subscribers;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
/**
* Class RegistrationDonorSubscriber
* @package FMT\Application\FormType\Subscribers
*/
class RegistrationDonorSubscriber implements EventSubscriberInterface
{
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return [
FormEvents::PRE_SET_DATA => 'preSetData'
];
}
/**
* @param FormEvent $event
*/
public function preSetData(FormEvent $event)
{
$form = $event->getForm();
$form->get('profile')->remove('phone');
$form->get('profile')->remove('school');
$form->get('profile')->remove('snapchatId');
$form->get('profile')->remove('facebookMessengerId');
$form->get('profile')->remove('otherEmail');
}
}