public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $data = $builder->getData();
     $isExist = $data->getId();
     $builder->remove('citezen')->remove('ssn_tin_1')->remove('ssn_tin_2')->remove('ssn_tin_3')->remove('is_senior_political_figure')->remove('senior_spf_name')->remove('senior_political_title')->remove('senior_account_owner_relationship')->remove('senior_country_office')->remove('is_publicly_traded_company')->remove('publicle_company_name')->remove('publicle_address')->remove('publicle_city')->remove('publicleState')->remove('is_broker_security_exchange_person')->remove('broker_security_exchange_company_name')->remove('compliance_letter_file')->add('email', 'email')->add('first_name', 'text', array('required' => false, 'disabled' => true))->add('middle_name', 'text', array('required' => false, 'disabled' => true))->add('last_name', 'text', array('required' => false, 'disabled' => true))->add('birth_date', 'date', array('widget' => 'single_text', 'format' => 'MM-dd-yyyy', 'required' => true, 'disabled' => true, 'attr' => array('class' => 'jq-date input-small')))->add('citizenship', 'choice', array('choices' => array(1 => 'Yes', 0 => 'No'), 'expanded' => true, 'multiple' => false, 'required' => false, 'property_path' => false, 'data' => $isExist ? 1 : null, 'label' => $data && $data->getMaritalStatus() == 'Married' ? 'Are you and your spouse both U.S. citizens?' : 'Are you a U.S. citizen?', 'disabled' => true))->add('marital_status', 'choice', array('choices' => Profile::getMaritalStatusChoices(), 'empty_value' => 'Choose an Option', 'required' => false))->add('phone_number', 'text', array('required' => false))->add('spouse', new ClientSpouseFormType())->add('annual_income', 'choice', array('choices' => Profile::getAnnualIncomeChoices(), 'empty_value' => 'Choose an Option', 'required' => false))->add('estimated_income_tax', 'percent', array('precision' => 0, 'required' => false, 'label' => 'What is your estimated income tax bracket?'))->add('liquid_net_worth', 'choice', array('choices' => Profile::getLiquidNetWorthChoices(), 'empty_value' => 'Choose an Option', 'required' => false));
     $formFactory = $builder->getFormFactory();
     $builder->addEventListener(FormEvents::PRE_BIND, function (FormEvent $event) use($formFactory) {
         $form = $event->getForm();
         $data = $event->getData();
         if ($data === null) {
             return;
         }
         if (isset($data['marital_status'])) {
             $form->remove('citizenship');
             $form->add($formFactory->createNamed('citizenship', 'choice', null, array('choices' => array(1 => 'Yes', 0 => 'No'), 'expanded' => true, 'multiple' => false, 'required' => false, 'property_path' => false, 'data' => isset($data['id']) ? 1 : null, 'label' => $data['marital_status'] == 'Married' ? 'Are you and your spouse both U.S. citizens?' : 'Are you a U.S. citizen?', 'disabled' => true)));
         }
     });
     $builder->addEventListener(FormEvents::BIND, array($this, 'changeProfileValidate'));
 }
 public function validate(FormEvent $event)
 {
     parent::validate($event);
     $this->validateOwnerInformation($event->getForm(), $event->getData());
 }