本文整理汇总了PHP中Address::setState方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::setState方法的具体用法?PHP Address::setState怎么用?PHP Address::setState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::setState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testapi
public function testapi()
{
$o_bcpc = new BaseCommerceClient(RENTSQUARE_MERCH_USER, RENTSQUARE_MERCH_PASS, RENTSQUARE_MERCH_KEY);
$o_bcpc->setSandbox(BC_SANDBOXVALUE);
$o_address = new Address();
$o_address->setName(Address::$XS_ADDRESS_NAME_BILLING);
$o_address->setLine1("123 Some Address");
$o_address->setCity("Tempe");
$o_address->setState("AZ");
$o_address->setZipcode("12345");
$o_bc = new BankCard();
$o_bc->setBillingAddress($o_address);
$o_bc->setExpirationMonth("02");
$o_bc->setExpirationYear("2015");
$o_bc->setName("Nick 2");
$o_bc->setNumber("4111111111111111");
$o_bc->setToken("myToken12asdfas3");
$o_bc = $o_bcpc->addBankCard($o_bc);
if ($o_bc->isStatus(BankCard::$XS_BC_STATUS_FAILED)) {
//the add Failed, look at messages array for reason(s) why
//var_dump( $o_bc->getMessages() );
$this->set('message', $o_bc->getMessages());
} else {
if ($o_bc->isStatus(BankCard::$XS_BC_STATUS_ACTIVE)) {
//Card added successfully
//var_dump( $o_bc->getToken() );
$this->set('message', $o_bc->getToken());
}
}
}
示例2: fromArray
public static function fromArray($data)
{
$address = new Address();
if (isset($data['street'])) {
$address->setStreet($data['street']);
}
if (isset($data['street2'])) {
$address->setStreet2($data['street2']);
}
if (isset($data['zip'])) {
$address->setZip($data['zip']);
}
if (isset($data['city'])) {
$address->setCity($data['city']);
}
if (isset($data['country'])) {
$address->setCountry($data['country']);
}
if (isset($data['state'])) {
$address->setState($data['state']);
}
if (isset($data['tel'])) {
$address->setTel($data['tel']);
}
if (isset($data['fax'])) {
$address->setFax($data['fax']);
}
if (isset($data['email'])) {
$address->setEmail($data['email']);
}
return $address;
}
示例3: createAddress
function createAddress()
{
$address = new Address();
$address->setAddress("Av. Tiradentes");
$address->setNumber("123");
$address->setComplement("Ap. 203");
$address->setNeighborhood("Centro");
$address->setCity("São Paulo");
$address->setState(StateEnum::SAO_PAULO);
$address->setZipCode("17500000");
return $address;
}
示例4: testSetAddressParameters
/**
* @group shopobjects
*/
function testSetAddressParameters()
{
// GIVEN
$incompleteAddressParameter = $this->givenIncompleteAddressParameter();
// WHEN
$address = new Address($incompleteAddressParameter);
$address->setBirthday("01.02.1900");
$address->setCity("Cologne");
$address->setCompany("FakeCompany");
$address->setCountry("England");
$address->setEmailAddress("a@b.cd");
$address->setFirstName("Max");
$address->setLastName("Miller");
$address->setSalutation("Mr.");
$address->setState("NRW");
$address->setStreet("First street 2");
$address->setStreetDetails("c/o Mister Smith");
$address->setTitle("Master");
$address->setVatId("DE1234567890");
$address->setZipCode("12345");
// THEN
$this->assertFalse($address->error());
$this->thenCompleteAddressInformationIsExisting($address);
}
示例5: validate
public function validate($street, $zip, $apartment = false, $city = false, $state = false)
{
$verify = new AddressVerify($this->config['username']);
$address = new Address();
$address->setFirmName(null);
$address->setApt($apartment);
$address->setAddress($street);
$address->setCity($city);
$address->setState($state);
$address->setZip5($zip);
$address->setZip4('');
// Add the address object to the address verify class
$verify->addAddress($address);
// Perform the request and return result
$val1 = $verify->verify();
$val2 = $verify->getArrayResponse();
// var_dump($verify->isError());
// See if it was successful
if ($verify->isSuccess()) {
return ['address' => $val2['AddressValidateResponse']['Address']];
} else {
return ['error' => $verify->getErrorMessage()];
}
}
示例6: buildFromJSON
/**
*
* Builds and Returns an Address object based off of the JSON input.
*
* @param vo_json JSON representation of an address
* @return the Address
* @throws JSONException if the json is not properly formatted
*/
static function buildFromJSON($o_data)
{
$o_instance = new Address();
if ($o_data != NULL) {
if (array_key_exists("address_name", $o_data)) {
$o_instance->setName($o_data['address_name']);
}
if (array_key_exists("address_line1", $o_data)) {
$o_instance->setLine1($o_data['address_line1']);
}
if (array_key_exists("address_line2", $o_data)) {
$o_instance->setLine2($o_data['address_line2']);
}
if (array_key_exists("address_city", $o_data)) {
$o_instance->setCity($o_data['address_city']);
}
if (array_key_exists("address_state", $o_data)) {
$o_instance->setState($o_data['address_state']);
}
if (array_key_exists("address_zipcode", $o_data)) {
$o_instance->setZipcode($o_data['address_zipcode']);
}
if (array_key_exists("address_country", $o_data)) {
$o_instance->setCountry($o_data['address_country']);
}
}
return $o_instance;
}
示例7: getBeanFromRequest
/**
* Populates the Venue object from the request
* @return bean Venue
*/
private function getBeanFromRequest()
{
$venue = new Venue();
$addr = new Address();
$addr->setOid($_REQUEST['aoid']);
$addr->setStreet($_REQUEST['street']);
$addr->setUnit($_REQUEST['unit']);
$addr->setCity($_REQUEST['city']);
$addr->setState($_REQUEST['state']);
$addr->setPostalCode($_REQUEST['postalCode']);
$addr->setPhone($_REQUEST['phone']);
$venue->setOid($_REQUEST['oid']);
$venue->setName($_REQUEST['name']);
$venue->setDescription($_REQUEST['description']);
$venue->setPubState($_REQUEST['pubState']);
$venue->setAddress($addr);
if (isset($_REQUEST['gallery'])) {
$venue->setGallery($_REQUEST['gallery']);
}
$links = array();
//$links['exhibition'] = $_REQUEST['exhibition'];
//$links['program'] = isset($_REQUEST['program']) ? $_REQUEST['program'] : null;
//$links['course'] = isset($_REQUEST['course']) ? $_REQUEST['course'] : null;
$venue->setEvents($links);
return $venue;
}
示例8: testSetState
/**
* @todo Implement testSetState().
*/
public function testSetState()
{
$this->object->setState(8);
$this->assertEquals($this->object->getState(), 8);
}
示例9: merchant_application
public function merchant_application($data)
{
$errors = array();
$results = array();
$i = 0;
// Instantiate State Model
$States = new State();
// Newest modification for Merchant Application submission
foreach ($data['Property'] as $property) {
// Create client
$o_bcpc = new BaseCommerceClient(RENTSQUARE_PARTNER_USER, RENTSQUARE_PARTNER_PASS, RENTSQUARE_PARTNER_KEY);
$o_bcpc->setSandbox(BC_SANDBOXVALUE);
$o_merch_app = new MerchantApplication();
$o_account = new Account();
// Account & Address infno
//$o_account->setAccountName( $property['legal_name'] );
$o_account->setAccountName("RentSquare LLC");
$o_account->setAcceptACH(true);
$o_account->setAcceptBC(true);
// Legal Address
$legal_state = $States->findById($property['legal_state_id']);
$legal_state = $legal_state['State']['abbr'];
$state_inc = $States->findById($property['state_inc']);
$state_inc = $state_inc['State']['abbr'];
$home_state = $States->findById($data['User']['state_id']);
$home_state = $home_state['State']['abbr'];
switch ($property['ownership_type']) {
case 0:
$ownership_type = 'Corporation';
break;
case 1:
$ownership_type = 'LLC';
break;
case 2:
$ownership_type = 'Partnership';
$state_inc = 'N/A';
break;
case 3:
$ownership_type = 'Sole Proprietor';
$property['legal_ein'] = $data['User']['ssn'];
$state_inc = 'N/A';
break;
}
$o_legal_address = new Address(Address::$XS_ADDRESS_NAME_LEGAL);
//$o_legal_address->setLine1( $property['legal_street'] );
//$o_legal_address->setCity( $property['legal_city'] );
//$o_legal_address->setState( $legal_state );
//$o_legal_address->setZipcode( $property['legal_zip'] );
$o_legal_address->setLine1("218 S. Formosa Ave");
$o_legal_address->setCity("Los Angeles");
$o_legal_address->setState("CA");
$o_legal_address->setZipcode("90036");
$o_legal_address->setCountry("USA");
$o_account->setLegalAddress($o_legal_address);
//$o_account->setAccountPhoneNumber( $property['legal_phone'] );
//$o_account->setCustomerServicePhoneNumber( $data['User']['phone'] );
//$o_account->setEIN( $property['legal_ein'] );
$o_account->setAccountPhoneNumber("303-809-6116");
$o_account->setReferralPartnerID("a0Fi0000005jNJ3");
//*** Hardcoded at BC
$o_account->setCongaTemplateId("a0d310000006iKoi");
//*** Hardcoded at BC
$o_account->setCustomerServicePhoneNumber("303-809-6116");
$o_account->setDBA($property['legal_dba']);
$o_account->setEntityType(Account::$XS_ENTITY_TYPE_CORP);
$o_account->setAssociationNumber("268000");
$o_account->setEIN("452501975");
$o_account->setIpAddressOfAppSubmission("192.168.0.1");
//*** Hardcoded at BC
$o_account->setWebsite('http://rentsquare.com');
// Settlement Account Bank Info
$o_account->setSettlementAccountBankName($property['bank_name']);
$o_account->setSettlementAccountBankPhone('');
//** TODO Required I think - need to add to form?
$o_account->setSettlementAccountName($property['legal_name']);
$o_account->setSettlementAccountNumber($property['bank_account_num']);
$o_account->setSettlementAccountRoutingNumber($property['routing_number']);
$o_account->setSettlementSameAsFeeAccount(true);
$o_merch_app->setAccount($o_account);
$o_dba_address = new Address(Address::$XS_ADDRESS_NAME_DBA);
$o_dba_address->setLine1($property['legal_street']);
$o_dba_address->setCity($property['legal_city']);
$o_dba_address->setState($state_inc);
//** Should this be legal state??
$o_dba_address->setZipcode($property['legal_zip']);
$o_dba_address->setCountry("USA");
$o_location = new Location();
$o_location->setContactSameAsOwner(true);
$o_location->setDescriptionOfProductsAndServices("Property Management Services");
$o_location->setDBAAddress($o_dba_address);
//$o_location->setDescription( Location::$XS_DESCRIPTION_CONSULTING ); // Dont see in Angela's document
//$o_cal = Calendar->getInstance(); //*** Hardcoded at BC
//$o_cal->add( Calendar->YEAR, -2 ); //*** Hardcoded at BC
//$o_year = $o_cal->getTime(); //*** Hardcoded at BC
//$o_location->setEntityStartDate( $o_year ); //*** Hardcoded at BC
$o_location->setEntityState($legal_state);
//** Should this be legal state??
$o_location->setSalesAgentName('Sean Perlmutter');
$o_location->setProgramPricing('RentSquare');
$o_location->setProgramDetails('Fees Billed to Partner');
//.........这里部分代码省略.........
示例10: setShippingAddress
/**
* Sets the shipping address for this payment request
* @param String $postalCode
* @param String $street
* @param String $number
* @param String $complement
* @param String $district
* @param String $city
* @param String $state
* @param String $country
*/
public function setShippingAddress($postalCode = null, $street = null, $number = null, $complement = null, $district = null, $city = null, $state = null, $country = null)
{
$param = $postalCode;
if ($this->shipping == null) {
$this->shipping = new Shipping();
}
if (is_array($param)) {
$this->shipping->setAddress(new Address($param));
} elseif ($param instanceof Address) {
$this->shipping->setAddress($param);
} else {
$address = new Address();
$address->setPostalCode($postalCode);
$address->setStreet($street);
$address->setNumber($number);
$address->setComplement($complement);
$address->setDistrict($district);
$address->setCity($city);
$address->setState($state);
$address->setCountry($country);
$this->shipping->setAddress($address);
}
}
示例11: getAddresses
public static function getAddresses($where = null)
{
$dados = Database::ReadAll("address a, city c, state s", "a.*, c.*, s.*", "WHERE a.id_city = c.id_city AND s.id_state = c.id_state " . $where);
if (!$dados) {
return '';
}
foreach ($dados as $dado) {
$address = new Address();
$address->setId($dado['ID_ADDRESS']);
$address->setStreet($dado['NAME_ADDRESS']);
$address->setNumber($dado['NUMBER']);
$address->setComplement($dado['COMPLEMENT']);
$address->setDistrict($dado['DISTRICT']);
$address->setLatitude($dados['LATITUDE']);
$address->setLongitude($dados['LONGITUDE']);
$address->setCity($dado['NAME_CITY']);
$address->setState($dado['INITIALS']);
$address->setPs($dado['PS']);
$addresses[] = $address;
}
return $addresses;
}
示例12: testInvalidState
/**
* @expectedException NfeFocus\Exception\FieldRequiredException
*/
public function testInvalidState()
{
$state = 'São Paulo';
$address = new Address();
$address->setState($state);
}
示例13: readTransaction
//.........这里部分代码省略.........
$transaction->setExtraAmount($data["extraAmount"]);
}
// <transaction> <installmentCount>
if (isset($data["installmentCount"])) {
$transaction->setInstallmentCount($data["installmentCount"]);
}
if (isset($data["items"]['item']) && is_array($data["items"]['item'])) {
$items = array();
$i = 0;
if (isset($data["items"]['item'][0])) {
foreach ($data["items"]['item'] as $key => $value) {
$item = self::parseTransactionItem($value);
$items[$i] = $item;
$i++;
}
} else {
$items[0] = self::parseTransactionItem($data["items"]['item']);
}
// <transaction> <items>
$transaction->setItems($items);
}
if (isset($data["sender"])) {
// <transaction> <sender>
$sender = new Sender();
// <transaction> <sender> <name>
if (isset($data["sender"]["name"])) {
$sender->setName($data["sender"]["name"]);
}
// <transaction> <sender> <email>
if (isset($data["sender"]["email"])) {
$sender->setEmail($data["sender"]["email"]);
}
if (isset($data["sender"]["phone"])) {
// <transaction> <sender> <phone>
$phone = new Phone();
// <transaction> <sender> <phone> <areaCode>
if (isset($data["sender"]["phone"]["areaCode"])) {
$phone->setAreaCode($data["sender"]["phone"]["areaCode"]);
}
// <transaction> <sender> <phone> <number>
if (isset($data["sender"]["phone"]["number"])) {
$phone->setNumber($data["sender"]["phone"]["number"]);
}
$sender->setPhone($phone);
}
$transaction->setSender($sender);
}
if (isset($data["shipping"]) && is_array($data["shipping"])) {
// <transaction> <shipping>
$shipping = new Shipping();
// <transaction> <shipping> <type>
if (isset($data["shipping"]["type"])) {
$shipping->setType(new ShippingType($data["shipping"]["type"]));
}
// <transaction> <shipping> <cost>
if (isset($data["shipping"]["cost"])) {
$shipping->setCost($data["shipping"]["cost"]);
}
if (isset($data["shipping"]["address"]) && is_array($data["shipping"]["address"])) {
// <transaction> <shipping> <address>
$address = new Address();
// <transaction> <shipping> <address> <street>
if (isset($data["shipping"]["address"]["street"])) {
$address->setStreet($data["shipping"]["address"]["street"]);
}
// <transaction> <shipping> <address> <number>
if (isset($data["shipping"]["address"]["number"])) {
$address->setNumber($data["shipping"]["address"]["number"]);
}
// <transaction> <shipping> <address> <complement>
if (isset($data["shipping"]["address"]["complement"])) {
$address->setComplement($data["shipping"]["address"]["complement"]);
}
// <transaction> <shipping> <address> <city>
if (isset($data["shipping"]["address"]["city"])) {
$address->setCity($data["shipping"]["address"]["city"]);
}
// <transaction> <shipping> <address> <state>
if (isset($data["shipping"]["address"]["state"])) {
$address->setState($data["shipping"]["address"]["state"]);
}
// <transaction> <shipping> <address> <district>
if (isset($data["shipping"]["address"]["district"])) {
$address->setDistrict($data["shipping"]["address"]["district"]);
}
// <transaction> <shipping> <address> <postalCode>
if (isset($data["shipping"]["address"]["postalCode"])) {
$address->setPostalCode($data["shipping"]["address"]["postalCode"]);
}
// <transaction> <shipping> <address> <country>
if (isset($data["shipping"]["address"]["country"])) {
$address->setCountry($data["shipping"]["address"]["country"]);
}
$shipping->setAddress($address);
}
// <transaction> <shipping>
$transaction->setShipping($shipping);
}
return $transaction;
}
示例14: getUserAddEditForm
//.........这里部分代码省略.........
//31 is the ID of Canada. It should be a SiteConfig variable
$form->addElement('hidden', 'shipping_country');
$form->addElement('static', 'shipping_country1', 'Country', 'Canada');
$form->addElement('header', 'save', 'Save');
if ($admin) {
$form->addElement('select', 'a_status', 'Active Status', $statuses);
}
$form->addElement('submit', 'a_submit', 'Save');
$form->addElement('reset', 'a_cancel', 'Cancel');
if (isset($this->user) && $this->user->hasPerm('assigngroups')) {
$sql = 'SELECT agp_id, agp_name from auth_groups';
$groups = Database::singleton()->query_fetch_all($sql);
$assignableGroup = array();
foreach ($groups as $group) {
$assignableGroup[$group['agp_id']] = $group['agp_name'];
}
if (@$this) {
$defaultValues['a_group'] = $this->getAuthGroup();
}
$form->addElement('select', 'a_group', 'Member Group', $assignableGroup);
}
$defaultValues['a_username'] = $this->getUsername();
$defaultValues['a_name'] = $this->getName();
//$defaultValues ['a_email'] = $this->getEmail();
$defaultValues['a_phone'] = $this->getPhone();
$defaultValues['a_join_newsletter'] = $this->getJoinNewsletter();
$defaultValues['a_password'] = null;
$defaultValues['a_password_confirm'] = null;
if (@$this->getAddress()) {
$defaultValues['a_address'] = @$this->getAddress()->getStreetAddress();
$defaultValues['a_city'] = @$this->getAddress()->getCity();
$defaultValues['a_postalcode'] = @$this->getAddress()->getPostalCode();
}
if (@$this->getShippingAddress()) {
$defaultValues['shipping_address'] = @$this->getShippingAddress()->getStreetAddress();
$defaultValues['shipping_city'] = @$this->getShippingAddress()->getCity();
$defaultValues['shipping_postalcode'] = @$this->getShippingAddress()->getPostalCode();
}
if ($admin) {
$defaultValues['a_status'] = $this->getActiveStatus();
}
$form->setDefaults($defaultValues);
$form->addRule('a_name', 'Please enter the user\'s name', 'required', null, 'client');
//$form->addRule( 'a_email', 'Please enter an email address', 'required', null, 'client' );
//$form->addRule( 'a_email', 'Please enter a valid email address', 'email', null, 'client' );
$form->addRule('a_phone', 'Please enter a phone number', 'required', null, 'client');
$form->addRule('a_address', 'Please enter a billing address', 'required', null, 'client');
$form->addRule('a_city', 'Please enter a billing address city', 'required', null, 'client');
$form->addRule('a_postalcode', 'Please enter a billing address postal code', 'required', null, 'client');
$form->addRule('shipping_address', 'Please enter a shipping address', 'required', null, 'client');
$form->addRule('shipping_city', 'Please enter a shipping address city', 'required', null, 'client');
$form->addRule('shipping_postalcode', 'Please enter a shipping address postal code', 'required', null, 'client');
if (!isset($_REQUEST['id'])) {
$form->addRule('a_password', 'Please enter a password', 'required', null, 'client');
$form->addRule('a_password_confirm', 'Please confirm the passwords match', 'required', null, 'client');
}
$form->addRule(array('a_password', 'a_password_confirm'), 'The passwords do not match', 'compare', null, 'client');
if (isset($_REQUEST['a_submit']) && $form->validate()) {
$this->setPassword($_REQUEST['a_password']);
if ($admin || @(!$_REQUEST['id'])) {
$this->setUsername($_REQUEST['a_username']);
$this->setEmail($_REQUEST['a_username']);
}
$this->setActiveStatus(1);
$this->setPhone($_REQUEST['a_phone']);
$this->setName($_REQUEST['a_name']);
$this->setJoinNewsletter(@$_REQUEST['a_join_newsletter']);
if (@$this->getAddress()) {
$billingTemp = new Address(@$this->getAddress()->getId());
} else {
$billingTemp = new Address();
}
$billingTemp->setStreetAddress($_REQUEST['a_address']);
$billingTemp->setCity($_REQUEST['a_city']);
$billingTemp->setPostalCode($_REQUEST['a_postalcode']);
$billingTemp->setState($_REQUEST['a_state']);
$billingTemp->setCountry($_REQUEST['a_country']);
$billingTemp->save();
$this->setAddress($billingTemp);
if (@$this->getShippingAddress()) {
$shippingTemp = new Address(@$this->getShippingAddress()->getId());
} else {
$shippingTemp = new Address();
}
$shippingTemp->setStreetAddress($_REQUEST['shipping_address']);
$shippingTemp->setCity($_REQUEST['shipping_city']);
$shippingTemp->setPostalCode($_REQUEST['shipping_postalcode']);
$shippingTemp->setState($_REQUEST['shipping_state']);
$shippingTemp->setCountry($_REQUEST['shipping_country']);
$shippingTemp->save();
$this->setShippingAddress($shippingTemp);
if ($this->save()) {
$_REQUEST["user_created"] = 1;
} else {
$form->addElement('static', 'Message', 'Username already exists');
$_REQUEST["username_already_exists"] = 1;
}
}
return $form;
}
示例15: testSetStateWorks
public function testSetStateWorks()
{
$address = new Address();
$address->setState('RS');
$this->assertEquals('RS', $address->getState());
}