Esempio n. 1
0
 /**
  * builds a location object from JSON object
  * @param type $vo_json JSON representation of the location object
  * @return Location the location object 
  * @author Rob Kurst <*****@*****.**>
  */
 static function buildFromJSON($vo_json)
 {
     $o_location = new Location();
     if (array_key_exists("location_annual_revenue", $vo_json)) {
         $o_location->setAnnualRevenue($vo_json["location_annual_revenue"]);
     }
     if (array_key_exists("location_contact_name", $vo_json)) {
         $o_location->setContactName($vo_json["location_contact_name"]);
     }
     if (array_key_exists("location_contact_email", $vo_json)) {
         $o_location->setContactEmail($vo_json["location_contact_email"]);
     }
     if (array_key_exists("location_efax", $vo_json)) {
         $o_location->setEFax($vo_json["location_efax"]);
     }
     if (array_key_exists("location_contact_mobile", $vo_json)) {
         $o_location->setContactMobile($vo_json["location_contact_mobile"]);
     }
     if (array_key_exists("location_contact_title", $vo_json)) {
         $o_location->setContactTitle($vo_json["location_contact_title"]);
     }
     if (array_key_exists("location_contact_same_as_owner", $vo_json)) {
         $o_location->setContactSameAsOwner($vo_json["location_contact_same_as_owner"]);
     }
     if (array_key_exists("location_fax", $vo_json)) {
         $o_location->setFax($vo_json["location_fax"]);
     }
     if (array_key_exists("location_industry", $vo_json)) {
         $o_location->setIndustry($vo_json["location_industry"]);
     }
     if (array_key_exists("location_ownership", $vo_json)) {
         $o_location->setOwnership($vo_json["location_ownership"]);
     }
     if (array_key_exists("location_years_in_business", $vo_json)) {
         $o_location->setYearsInBusiness($vo_json["location_years_in_business"]);
     }
     if (array_key_exists("location_organization_mission", $vo_json)) {
         $o_location->setOrganizationMission($vo_json["location_organization_mission"]);
     }
     if (array_key_exists("location_entity_start_date", $vo_json)) {
         $o_location->setEntityStartDate(date("m/d/Y H:i:s", strtotime($vo_json["location_entity_start_date"])));
     }
     if (array_key_exists("location_entity_state", $vo_json)) {
         $o_location->setEntityState($vo_json["location_entity_state"]);
     }
     if (array_key_exists("location_alternative_fax", $vo_json)) {
         $o_location->setAlternativeFax($vo_json["location_alternative_fax"]);
     }
     if (array_key_exists("location_year_incorporated", $vo_json)) {
         $o_location->setYearIncorporated($vo_json["location_year_incorporated"]);
     }
     if (array_key_exists("location_description_of_products_and_services", $vo_json)) {
         $o_location->setDescriptionOfProductsAndServices($vo_json["location_description_of_products_and_services"]);
     }
     if (array_key_exists("location_length_of_current_ownership", $vo_json)) {
         $o_location->setLengthOfCurrentOwnership($vo_json["location_length_of_current_ownership"]);
     }
     if (array_key_exists("location_quantity_of_locations", $vo_json)) {
         $o_location->setQuantityOfLocation($vo_json["location_quantity_of_locations"]);
     }
     if (array_key_exists("location_waive_pg", $vo_json)) {
         $o_location->setWaivePg($vo_json["location_waive_pg"]);
     }
     if (array_key_exists("location_partner_biller_id", $vo_json)) {
         $o_location->setPartnerBillerId($vo_json["location_partner_biller_id"]);
     }
     if (array_key_exists("location_partner_reseller_id", $vo_json)) {
         $o_location->setPartnerResellerId($vo_json["location_partner_reseller_id"]);
     }
     if (array_key_exists("location_partner_sub_account_id", $vo_json)) {
         $o_location->setPartnerSubAccountId($vo_json["location_partner_sub_account_id"]);
     }
     if (array_key_exists("location_program_pricing", $vo_json)) {
         $o_location->setProgramPricing($vo_json["location_program_pricing"]);
     }
     if (array_key_exists("location_program_details", $vo_json)) {
         $o_location->setProgramDetails($vo_json["location_program_details"]);
     }
     if (array_key_exists("location_lead_sources", $vo_json)) {
         $o_lead_sources = $vo_json["location_lead_sources"];
         for ($n_index = 0, $n_size = count($o_lead_sources); $n_index < $n_size; $n_index++) {
             $o_location->addLeadSource($o_lead_sources[$n_index]);
         }
     }
     if (array_key_exists("location_sales_agent_name", $vo_json)) {
         $o_location->setSalesAgentName($vo_json["location_sales_agent_name"]);
     }
     if (array_key_exists("location_parent_id", $vo_json)) {
         $o_location->setParentId($vo_json["location_parent_id"]);
     }
     if (array_key_exists("location_additional_description", $vo_json)) {
         $o_location->setAdditionalDescription($vo_json["location_additional_description"]);
     }
     if (array_key_exists("location_description", $vo_json)) {
         $o_location->setDescription($vo_json["location_description"]);
     }
     if (array_key_exists("location_new_visa_utility_acceptor", $vo_json)) {
         $o_location->setNewVisaUtilityAcceptor($vo_json["location_new_visa_utility_acceptor"]);
     }
     if (array_key_exists("location_tax_exempt", $vo_json)) {
         $o_location->setTaxExempt($vo_json["location_tax_exempt"]);
     }
     if (array_key_exists("location_total_customers", $vo_json)) {
         $o_location->setTotalCustomers($vo_json["location_total_customers"]);
     }
     if (array_key_exists("location_utility_ownership", $vo_json)) {
         $o_location->setUtilityOwnership($vo_json["location_utility_ownership"]);
     }
     if (array_key_exists("location_terminals", $vo_json)) {
         $o_terminals = $vo_json["location_terminals"];
         for ($n_index = 0, $n_size = count($o_terminals); $n_index < $n_size; $n_index++) {
             $o_location->addTerminal($o_terminals[$n_index]);
         }
     }
     if (array_key_exists("location_principal_contacts", $vo_json)) {
         $o_contacts = $vo_json["location_principal_contacts"];
         for ($n_index = 0, $n_size = count($o_contacts); $n_index < $n_size; $n_index++) {
             $o_contact = PrincipalContact::buildFromJSON($o_contacts[$n_index]);
             $o_location->addPrincipalContact($o_contact);
         }
     }
     if (array_key_exists("location_bc_details", $vo_json) && $vo_json["location_bc_details"] != null) {
         $o_location->setBankCardDetails(BankCardDetails::buildFromJSON($vo_json["location_bc_details"]));
     }
     if (array_key_exists("location_ach_details", $vo_json) && $vo_json["location_ach_details"] != null) {
         $o_location->setAchDetails(ACHDetails::buildFromJSON($vo_json["location_ach_details"]));
     }
     if (array_key_exists("location_moto", $vo_json) && $vo_json["location_moto"] != null) {
         $o_location->setMoto(MOTO::buildFromJSON($vo_json["location_moto"]));
     }
     if (array_key_exists("location_internet", $vo_json) && $vo_json["location_internet"] != null) {
         $o_location->setInternet(Internet::buildFromJSON($vo_json["location_internet"]));
     }
     if (array_key_exists("location_pos", $vo_json) && $vo_json["location_pos"] != null) {
         $o_location->setPos(POS::buildFromJSON($vo_json["location_pos"]));
     }
     if (array_key_exists("location_dba_address", $vo_json)) {
         $o_dba_address = Address::buildFromJSON($vo_json["location_dba_address"]);
         $o_location->setDBAAddress($o_dba_address);
     }
     if (array_key_exists("location_chargeback_fax", $vo_json)) {
         $o_location->setChargebackFax($vo_json["location_chargeback_fax"]);
     }
     return $o_location;
 }
Esempio n. 2
0
 public static function buildFromJSON($vo_json)
 {
     $o_moto = new MOTO();
     if (array_key_exists("moto_processing_methods", $vo_json)) {
         $o_processing_methods = $vo_json["moto_processing_methods"];
         for ($n_index = 0, $n_size = count($o_processing_methods); $n_index < $n_size; $n_index++) {
             $o_moto->addProcessingMethod($o_processing_methods[$n_index]);
         }
     }
     if (array_key_exists("moto_order_forms", $vo_json)) {
         $o_moto->setOrderForms($vo_json["moto_order_forms"]);
     }
     if (array_key_exists("moto_software_retain", $vo_json)) {
         $o_moto->setSoftwareRetain($vo_json["moto_software_retain"]);
     }
     if (array_key_exists("moto_outbound_marketing", $vo_json)) {
         $o_outbound_marketing = $vo_json["moto_outbound_marketing"];
         for ($n_index = 0, $n_size = count($o_outbound_marketing); $n_index < $n_size; $n_index++) {
             $o_moto->addOutboundMarketing($o_outbound_marketing[$n_index]);
         }
     }
     if (array_key_exists("moto_outbound_telemarketing_is_conducted", $vo_json)) {
         $o_moto->setOutboundTelemarketingIsConducted($vo_json["moto_outbound_telemarketing_is_conducted"]);
     }
     return $o_moto;
 }