Пример #1
0
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $account = $builder->getData();
     $this->factory = $builder->getFormFactory();
     $statusChoices = array(SystemAccount::STATUS_ACTIVE => 'Account active', SystemAccount::STATUS_CLOSED => 'Account closed');
     $builder->add('dateClosed', 'date', array('attr' => array('class' => 'jq-ce-date input-small'), 'format' => 'MM-dd-yyyy', 'property_path' => 'systemAccount.closed', 'required' => false, 'widget' => 'single_text'))->add('status', 'choice', array('attr' => array('class' => 'input-medium'), 'property_path' => 'systemAccount.status', 'choices' => $statusChoices))->add('firstName', 'text', array('attr' => array('class' => 'input-small'), 'label' => 'First Name', 'property_path' => 'primaryApplicant.firstName'))->add('lastName', 'text', array('attr' => array('class' => 'input-small'), 'label' => 'Last Name', 'property_path' => 'primaryApplicant.lastName'));
     $builder->add('accountNumber', 'text', array('attr' => array('class' => 'input-small'), 'label' => 'Account Number: ', 'property_path' => 'systemAccount.accountNumber'))->add('accountType', 'choice', array('attr' => array('class' => 'input-xlarge'), 'choices' => SystemAccount::getTypeChoices(), 'label' => 'Account Type: ', 'property_path' => 'systemAccount.type'))->add('sasCash', 'money', array('attr' => array('class' => 'input-mini'), 'currency' => 'USD', 'label' => 'SAS Cash'))->add('performanceInception', 'date', array('attr' => array('class' => 'jq-date input-small'), 'format' => 'MM-dd-yyyy', 'label' => 'Performance Inception: ', 'property_path' => 'systemAccount.performanceInception', 'widget' => 'single_text'))->add('billingInception', 'date', array('attr' => array('class' => 'jq-date input-small'), 'format' => 'MM-dd-yyyy', 'label' => 'Billing Inception: ', 'property_path' => 'systemAccount.billingInception', 'widget' => 'single_text'))->add('billingAccount', 'entity', array('class' => 'WealthbotClientBundle:SystemAccount', 'label' => 'Billing Account: ', 'property_path' => 'systemAccount.billingAccount', 'query_builder' => function (EntityRepository $er) use($account) {
         return $er->createQueryBuilder('systemAccounts')->where('systemAccounts.client = :client')->setParameter('client', $account->getClient());
     }));
     $builder->addEventListener(FormEvents::PRE_SET_DATA, array($this, 'onPreSetData'));
     $builder->addEventListener(FormEvents::BIND, array($this, 'onBindData'));
 }
Пример #2
0
 /**
  * Get closed
  *
  * @return \DateTime 
  */
 public function getClosed()
 {
     return parent::getClosed();
 }
Пример #3
0
 /**
  * Get system_type as string
  *
  * @return string
  */
 public function getSystemTypeAsString()
 {
     $types = SystemAccount::getTypeChoices();
     return $types[$this->system_type];
 }