public function preSetData(FormEvent $event)
    {
        $user = $event->getData();
        if (null === $user) {
            return;
        }
        if($this->currentUser !== null && $this->currentUser !== $user) {
            $event->getForm()->add($this->factory->createNamed('activated', 'checkbox', null, array(
                'data' => $user->getRegistrationToken() ? false : true,
                'auto_initialize' => false,
                'label' => 'Activated',
                'required' => false,
                'mapped' => false)));
        }
    }
public function preSetData(FormEvent $event)
    {
        $user = $event->getData();
        if (null === $user) {
            return;
        }
        if($this->currentUser !== null && $this->currentUser !== $user) {
            $event->getForm()->add($this->factory->createNamed('activated', 'checkbox', null, array(
                'data' => $user->getRegistrationToken() ? false : true,
                'auto_initialize' => false,
                'label' => 'Activated',
                'required' => false,
                'mapped' => false)));
        }
    }
public function preSetData ( FormEvent $ event ) { $ user = $ event -> getData ( ) ; if ( null === $ user ) { return ; } if ( $ this -> currentUser !== null && $ this -> currentUser !== $ user ) { $ event -> getForm ( ) -> add ( $ this -> factory -> createNamed ( 'activated' , 'checkbox' , null , array ( 'data' => $ user -> getRegistrationToken ( ) ? false : true , 'auto_initialize' => false , 'label' => 'Activated' , 'required' => false , 'mapped' => false ) ) ) ; } }
Checkt form fields by PRE_SET_DATA FormEvent

@param FormEvent $event
Checkt form fields by PRE_SET_DATA FormEvent