/**
  * Build data for contribution form
  *
  * @param string $action
  * @param SystemAccount $account
  * @return AccountContribution|OneTimeContribution
  */
 private function buildFormData($action, SystemAccount $account)
 {
     $clientAccount = $account->getClientAccount();
     $existContribution = $account->getAccountContribution();
     switch ($action) {
         case 'one_time':
             $data = $this->buildOneTimeContributionData($clientAccount, $existContribution);
             break;
         case 'create':
             $data = $this->buildCreateContributionData($clientAccount, $existContribution);
             break;
         default:
             $data = $this->buildUpdateContributionData($existContribution);
             break;
     }
     return $data;
 }
Beispiel #2
0
 /**
  * Get client account object
  *
  * @return \Wealthbot\ClientBundle\Model\ClientAccount
  */
 public function getClientAccount()
 {
     return $this->systemClientAccount ? $this->systemClientAccount->getClientAccount() : null;
 }
 /**
  * Get client account object
  *
  * @return \Wealthbot\ClientBundle\Model\ClientAccount
  */
 public function getClientAccount()
 {
     return $this->systemAccount->getClientAccount();
 }
 public function __construct(FormFactoryInterface $factory, EntityManager $em, SystemAccount $systemAccount)
 {
     $this->systemAccount = $systemAccount;
     parent::__construct($factory, $em, $systemAccount->getClientAccount());
 }
 public function __construct(EntityManager $em, SystemAccount $account, EventSubscriberInterface $subscriber = null)
 {
     parent::__construct($em, $account->getClientAccount(), $subscriber, false);
 }