当前位置: 首页>>代码示例>>PHP>>正文


PHP Address::getCountry方法代码示例

本文整理汇总了PHP中Address::getCountry方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::getCountry方法的具体用法?PHP Address::getCountry怎么用?PHP Address::getCountry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Address的用法示例。


在下文中一共展示了Address::getCountry方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gettersShouldReturnTheAttributeValue

 /**
  * @test
  */
 public function gettersShouldReturnTheAttributeValue()
 {
     $this->assertAttributeEquals($this->address->getCountry(), 'country', $this->address);
     $this->assertAttributeEquals($this->address->getState(), 'state', $this->address);
     $this->assertAttributeEquals($this->address->getCity(), 'city', $this->address);
     $this->assertAttributeEquals($this->address->getPostalCode(), 'postalCode', $this->address);
     $this->assertAttributeEquals($this->address->getDistrict(), 'district', $this->address);
     $this->assertAttributeEquals($this->address->getStreet(), 'street', $this->address);
     $this->assertAttributeEquals($this->address->getNumber(), 'number', $this->address);
     $this->assertAttributeEquals($this->address->getComplement(), 'complement', $this->address);
 }
开发者ID:leonardorifeli,项目名称:pagseguro,代码行数:14,代码来源:AddressTest.php

示例2: __construct

 public function __construct($name, TaxIdNumber $taxIdNumber, Address $address, BankAccount $account)
 {
     $this->name = $name;
     $this->taxIdNumber = (string) $taxIdNumber;
     $this->postalCode = $address->getPostalCode();
     $this->street = $address->getStreet();
     $this->city = $address->getCity();
     $this->country = $address->getCountry();
     $this->bankName = $account->getBankName();
     $this->bankNumber = $account->getBankNumber();
     $this->bicCode = $account->getBicCode();
 }
开发者ID:cocoders,项目名称:event-store,代码行数:12,代码来源:Buyer.php

示例3: modify

 protected function modify(Address $address)
 {
     $q = $this->dao->prepare('UPDATE ' . $this->table() . ' SET TITLE = :title, ADDRESS_1 = :address1, ADDRESS_2 = :address2, ZIP_CODE = :zipCode, CITY = :city, COUNTRY = :country, USER_ID = :userId WHERE ID = :id');
     $q->bindValue(':title', $address->getTitle());
     $q->bindValue(':address1', $address->getAddress1());
     $q->bindValue(':address2', $address->getAddress2());
     $q->bindValue(':zipCode', $address->getZipCode());
     $q->bindValue(':city', $address->getCity());
     $q->bindValue(':country', $address->getCountry());
     $q->bindValue(':userId', $address->getUserId(), PDO::PARAM_INT);
     $q->bindValue(':id', $address->id(), PDO::PARAM_INT);
     $q->execute();
 }
开发者ID:Tipkin-Commons,项目名称:tipkin,代码行数:13,代码来源:AddressesManager_PDO.class.php

示例4: format

 /**
  * Formats an address.
  *
  * @param \Libreworks\Microformats\Address $address
  * @return string The HTML markup
  */
 public function format(Address $address)
 {
     $fields = ['p-street-address' => $address->getStreet(), 'p-extended-address' => $address->getExtended(), 'p-post-office-box' => $address->getPobox(), 'p-locality' => $address->getLocality(), 'p-region' => $address->getRegion(), 'p-postal-code' => $address->getPostal(), 'p-country' => $address->getCountry()];
     $tags = [];
     foreach ($fields as $k => $v) {
         if (strlen($v) > 0) {
             $tags[] = '<span class="' . $k . '">' . htmlspecialchars($v) . '</span>';
         }
     }
     $geo = $address->getGeo();
     if ($geo !== null) {
         $tags[] = '<span class="p-geo">' . $this->geoFormatter->format($geo) . '</span>';
     }
     return '<span class="h-adr">' . implode(' ', $tags) . '</span>';
 }
开发者ID:libreworks,项目名称:microformats,代码行数:21,代码来源:AddressFormatter.php

示例5: __construct

 public function __construct($name, TaxIdNumber $taxIdNumber, Address $address, BankAccount $account)
 {
     if (!$name) {
         throw new \InvalidArgumentException('Name is required');
     }
     $this->name = $name;
     $this->taxIdNumber = (string) $taxIdNumber;
     $this->postalCode = $address->getPostalCode();
     $this->street = $address->getStreet();
     $this->city = $address->getCity();
     $this->country = $address->getCountry();
     $this->bankName = $account->getBankName();
     $this->bankNumber = $account->getBankNumber();
     $this->bicCode = $account->getBicCode();
 }
开发者ID:cocoders,项目名称:event-store,代码行数:15,代码来源:Seller.php

示例6: calculateTax

    public static function calculateTax($taxClass, $productPrice, $address)
    {
        if (!$address) {
            $address = new Address();
        }
        $country = $address->getCountry();
        $province = $address->getState();
        $sql = 'select `tax_rate` from ecomm_tax_rate where country = "' . e($country) . '" AND 
															province = "' . e($province) . '" AND
															tax_class = "' . e($taxClass) . '"';
        $result = Database::singleton()->query_fetch($sql);
        $taxRate = $result['tax_rate'];
        if (!$taxRate) {
            $taxRate = 0;
        }
        $taxRate = $taxRate / 100;
        return (double) $taxRate * (double) $productPrice;
    }
开发者ID:anas,项目名称:feedstore,代码行数:18,代码来源:TaxRate.php

示例7: update

 /**
  * 返回更新国家信息
  * @access public
  */
 function update()
 {
     $m = new Address();
     $id = get_post_value('id');
     $data = $m->getCountry($id);
     //返回查询国家数据(model模式)
     $this->assign('data', $data);
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:12,代码来源:CountryController.class.php

示例8: testGetCountry

 /**
  * Tests Address->getCountry()
  */
 public function testGetCountry()
 {
     $this->assertEquals('COUNTRY', $this->Address->getCountry());
 }
开发者ID:ahmedadham88,项目名称:enhanced-social-network,代码行数:7,代码来源:AddressTest.php

示例9: beforeAction

 /**
  * 系统函数
  * @access public
  */
 function beforeAction()
 {
     $m = new Address();
     $data = $m->getCountry();
     $this->assign('country', $data);
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:10,代码来源:RegionController.class.php

示例10: testSetCountry

 /**
  * @todo Implement testSetCountry().
  */
 public function testSetCountry()
 {
     $this->object->setCountry(8);
     $this->assertEquals($this->object->getCountry(), 8);
 }
开发者ID:swat30,项目名称:safeballot,代码行数:8,代码来源:AddressTest.php

示例11: encodeAddress

 public function encodeAddress(Address $address)
 {
     return ['street' => $address->getStreet(), 'street2' => $address->getStreet2(), 'zip' => $address->getZip(), 'city' => $address->getCity(), 'country' => $address->getCountry(), 'state' => $address->getState(), 'email' => $address->getEmail(), 'tel' => $address->getTel(), 'fax' => $address->getZip()];
 }
开发者ID:tomaj,项目名称:invoice-client,代码行数:4,代码来源:Serializer.php

示例12: testSetCountry

 /**
  * Tests Address->setCountry()
  */
 public function testSetCountry()
 {
     $this->Address->setCountry('country');
     $this->assertEquals('country', $this->Address->getCountry());
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:8,代码来源:AddressTest.php


注:本文中的Address::getCountry方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。