Ejemplo n.º 1
0
 /**
  * Builds a BankAccount PHP object from the passed in json object.
  * 
  * @param  $vo_json - The json representation of the object to be built.
  * @return A BankAccount object with fields based on the input json object.
  * @author Ryan Murphy <*****@*****.**>
  * @author Steven Wright <*****@*****.**>
  */
 static function buildFromJSON($vo_json)
 {
     $o_bank_account = new BankAccount();
     if (array_key_exists("bank_account_name", $vo_json)) {
         $o_bank_account->setName($vo_json["bank_account_name"]);
     }
     if (array_key_exists("bank_account_alias", $vo_json)) {
         $o_bank_account->setAlias($vo_json["bank_account_alias"]);
     }
     if (array_key_exists("bank_account_account_number", $vo_json)) {
         $o_bank_account->setAccountNumber($vo_json["bank_account_account_number"]);
     }
     if (array_key_exists("bank_account_routing_number", $vo_json)) {
         $o_bank_account->setRoutingNumber($vo_json["bank_account_routing_number"]);
     }
     if (array_key_exists("bank_account_token", $vo_json)) {
         $o_bank_account->setToken($vo_json["bank_account_token"]);
     }
     if (array_key_exists("bank_account_billing_address", $vo_json)) {
         $o_bank_account->setBillingAddress(Address::buildFromJSON($vo_json["bank_account_billing_address"]));
     }
     if (array_key_exists('bank_account_status', $vo_json)) {
         if (gettype($vo_json['bank_account_status']) === "array ") {
             $o_status = (array) $vo_json['bank_account_status'];
             if (array_key_exists('bank_account_status_name', $o_status)) {
                 $o_bank_account->setStatus($o_status['bank_account_status_name']);
             }
         } else {
             $o_bank_account->setStatus($vo_json['bank_account_status']);
         }
     }
     if (array_key_exists('bank_account_type', $vo_json)) {
         if (gettype($vo_json['bank_account_type']) === "array") {
             $o_type = (array) $vo_json['bank_account_type'];
             if (array_key_exists('bank_account_type_name', $o_type)) {
                 $o_bank_account->setAccountType($o_type['bank_account_type_name']);
             }
         } else {
             $o_bank_account->setAccountType($vo_json['bank_account_type']);
         }
     }
     return $o_bank_account;
 }