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


PHP Country::setName方法代码示例

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


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

示例1: construct

 public static function construct($array)
 {
     $obj = new Country();
     $obj->setName($array['name']);
     $obj->setCode($array['code']);
     $obj->setStates($array['states']);
     return $obj;
 }
开发者ID:ivanknow,项目名称:curso-angular-php-pl,代码行数:8,代码来源:Country.php

示例2: getCountries

 /**
  * 
  * @return multitype:Country creates an array of all the data a country has.
  */
 public static function getCountries()
 {
     $countries = array();
     $country = new Country();
     $country->setId(1);
     $country->setName('America');
     $countries[$country->getId()] = $country;
     $country2 = new Country();
     $country2->setId(2);
     $country2->setname('Germany');
     $countries[$country2->getId()] = $country2;
     return $countries;
 }
开发者ID:piiskop,项目名称:pstk,代码行数:17,代码来源:Country.php

示例3: buildMerchants

 public function buildMerchants($xml)
 {
     $merchants = new Merchants();
     $merchants->setPageOffset((string) $xml->PageOffset);
     $merchants->setTotalCount((string) $xml->TotalCount);
     // merchant
     $merchantArray = array();
     foreach ($xml->Merchant as $merchant) {
         $tmpMerchant = new Merchant();
         $tmpMerchant->setId((string) $merchant->Id);
         $tmpMerchant->setName((string) $merchant->Name);
         $tmpMerchant->setWebsiteUrl((string) $merchant->WebsiteUrl);
         $tmpMerchant->setPhoneNumber((string) $merchant->PhoneNumber);
         $tmpMerchant->setCategory((string) $merchant->Category);
         $tmpLocation = new Location();
         $location = $merchant->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         // ACCEPTANCE FRAMEWORK NEEDS LOOKED AT <RETURN XML AND DOC DOES NOT HAVE ALL VALUES>
         //$tmpAcceptance = new Acceptance();
         //$acceptance = $merchant->Acceptance;
         // FEATURES FRAMEWORK NEEDS LOOKED AT <RETURN XML AND DOC DOES NOT HAVE ALL VALUES>
         //$tmpFeatures = new Features();
         //$features =  $merchant->Features;
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpMerchant->setLocation($tmpLocation);
         array_push($merchantArray, $tmpMerchant);
     }
     $merchants->setMerchant($merchantArray);
     return $merchants;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:51,代码来源:MerchantLocationService.php

示例4: buildCountries

 private function buildCountries($xml)
 {
     $countries = new Countries();
     $countryArray = array();
     foreach ($xml->Country as $country) {
         $tmpCountry = new Country();
         $tmpCountry->setCode((string) $country->Code);
         $tmpCountry->setGeoCoding((string) $country->Geocoding);
         $tmpCountry->setName((string) $country->Name);
         array_push($countryArray, $tmpCountry);
     }
     $countries->setCountry($countryArray);
     return $countries;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:14,代码来源:CountriesLocalFavoritesService.php

示例5: buildAtms

 public function buildAtms($xml)
 {
     $atms = new Atms();
     $atms->setPageOffset($xml->PageOffset);
     $atms->setTotalCount($xml->TotalCount);
     $atmArray = array();
     foreach ($xml->Atm as $atm) {
         $tmpAtm = new Atm();
         $tmpAtm->setHandicapAccessible((string) $atm->HandicapAccessible);
         $tmpAtm->setCamera((string) $atm->Camera);
         $tmpAtm->setAvailability((string) $atm->Availability);
         $tmpAtm->setAccessFees((string) $atm->AccessFees);
         $tmpAtm->setOwner((string) $atm->Owner);
         $tmpAtm->setSharedDeposit((string) $atm->SharedDeposit);
         $tmpAtm->setSurchargeFreeAlliance((string) $atm->SurchargeFreeAlliance);
         $tmpAtm->setSponsor((string) $atm->Sponsor);
         $tmpAtm->setSupportEMV((string) $atm->SupportEMV);
         $tmpAtm->setSurchargeFreeAllianceNetwork((string) $atm->SurchargeFreeAllianceNetwork);
         $tmpLocation = new Location();
         $location = $atm->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpAtm->setLocation($tmpLocation);
         array_push($atmArray, $tmpAtm);
     }
     $atms->setAtm($atmArray);
     return $atms;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:49,代码来源:AtmLocationService.php

示例6: suggestCountries

 /**
  * Return an associated array of countries to be used for the suggestion tool.
  * @global type $db
  * @param type $term
  * @return array - associated array;
  */
 public function suggestCountries($term)
 {
     global $db;
     $query = "SELECT code, name, ISO_Alpha2 FROM countries WHERE name LIKE '" . strip_tags($term) . "%' ORDER BY name LIMIT 10";
     //echo($query);
     // make query
     $result = $db->getall($query);
     // initialize arrays.
     $countries = array();
     foreach ($result as $r) {
         $country = new Country($r["code"]);
         $country->setName(trim($r["name"]));
         $country->setIso2(trim($r["ISO_Alpha2"]));
         array_push($countries, $country);
     }
     return $countries;
 }
开发者ID:ralvarezpa,项目名称:gap-analysis-cwr,代码行数:23,代码来源:CountryMySQL.php

示例7: buildAtms

 public function buildAtms($xml)
 {
     $pageOffset = (string) $xml->PageOffset;
     $totalCount = (string) $xml->TotalCount;
     $restaurantArray = array();
     foreach ($xml->Restaurant as $restaurant) {
         $tmpRestaurant = new Restaurant();
         $tmpRestaurant->setId((string) $restaurant->Id);
         $tmpRestaurant->setName((string) $restaurant->Name);
         $tmpRestaurant->setWebsiteUrl((string) $restaurant->WebsiteUrl);
         $tmpRestaurant->setPhoneNumber((string) $restaurant->PhoneNumber);
         $tmpRestaurant->setCategory((string) $restaurant->Category);
         $tmpRestaurant->setLocalFavoriteInd((string) $restaurant->LocalFavoriteInd);
         $tmpRestaurant->setHiddenGemInd((string) $restaurant->HiddenGemInd);
         $tmpLocation = new Location();
         $location = $restaurant->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpRestaurant->setLocation($tmpLocation);
         array_push($restaurantArray, $tmpRestaurant);
     }
     $restaurants = new Restaurants($pageOffset, $totalCount, $restaurantArray);
     return $restaurants;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:45,代码来源:RestaurantsLocalFavoritesService.php

示例8: testGetLocationsMappedToOperationalCountry_Success

 /**
  * @covers OperationalCountryService::getLocationsMappedToOperationalCountry
  */
 public function testGetLocationsMappedToOperationalCountry_Success()
 {
     $locationList = array();
     $locationList[] = new Location();
     $locationList[] = new Location();
     $locationList[] = new Location();
     $sriLanka = new Country();
     $sriLanka->setName('Sri Lanka');
     $operationalCountry = new OperationalCountry();
     $operationalCountry->setId(1);
     $operationalCountry->setCountry($sriLanka);
     $operationalCountry->setCountryCode('LK');
     $operationalCountryDaoMock = $this->getMock('OperationalCountryDao', array('getLocationsMappedToOperationalCountry'));
     $operationalCountryDaoMock->expects($this->once())->method('getLocationsMappedToOperationalCountry')->will($this->returnValue($locationList));
     $result = $this->service->setOperationalCountryDao($operationalCountryDaoMock);
     $result = $this->service->getLocationsMappedToOperationalCountry($operationalCountry);
     $this->assertEquals($locationList, $result);
 }
开发者ID:THM068,项目名称:orangehrm,代码行数:21,代码来源:OperationalCountryServiceTest.php

示例9: buildMerchantIds

 public function buildMerchantIds($xml)
 {
     $merchantArray = array();
     foreach ($xml->ReturnedMerchants->Merchant as $merchant) {
         $xmlAddress = $merchant->Address;
         $xmlCountrySubdivision = $merchant->Address->CountrySubdivision;
         $xmlCountry = $merchant->Address->Country;
         $xmlMerchant = $merchant;
         $address = new Address();
         $address->setLine1((string) $xmlAddress->Line1);
         $address->setLine2((string) $xmlAddress->Line2);
         $address->setCity((string) $xmlAddress->City);
         $address->setPostalCode((string) $xmlAddress->PostalCode);
         $countrySubdivision = new CountrySubdivision();
         $countrySubdivision->setCode((string) $xmlCountrySubdivision->Code);
         $countrySubdivision->setName((string) $xmlCountrySubdivision->Name);
         $country = new Country();
         $country->setCode((string) $xmlCountry->Code);
         $country->setName((string) $xmlCountry->Name);
         $address->setCountrySubdivision($countrySubdivision);
         $address->setCountry($country);
         $tmpMerchant = new Merchant();
         $tmpMerchant->setAddress($address);
         $tmpMerchant->setPhoneNumber((string) $xmlMerchant->PhoneNumber);
         $tmpMerchant->setBrandName((string) $xmlMerchant->BrandName);
         $tmpMerchant->setMerchantCategory((string) $xmlMerchant->MerchantCategory);
         $tmpMerchant->setMerchantDbaName((string) $xmlMerchant->MerchantDbaName);
         $tmpMerchant->setDescriptorText((string) $xmlMerchant->DescriptorText);
         $tmpMerchant->setLegalCorporateName((string) $xmlMerchant->LegalCorporateName);
         $tmpMerchant->setBrickCount((string) $xmlMerchant->BrickCount);
         $tmpMerchant->setComment((string) $xmlMerchant->Comment);
         $tmpMerchant->setLocationId((string) $xmlMerchant->LocationId);
         $tmpMerchant->setOnlineCount((string) $xmlMerchant->OnlineCount);
         $tmpMerchant->setOtherCount((string) $xmlMerchant->OtherCount);
         $tmpMerchant->setSoleProprietorName((string) $xmlMerchant->SoleProprietorName);
         array_push($merchantArray, $tmpMerchant);
     }
     $returnedMerchants = new ReturnedMerchants();
     $returnedMerchants->setMerchant($merchantArray);
     $merchantIds = new MerchantIds();
     $merchantIds->setReturnedMerchants($returnedMerchants);
     $merchantIds->setMessage($xml->Message);
     return $merchantIds;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:44,代码来源:MerchantIdentifierService.php

示例10: getCountries

 protected function getCountries()
 {
     $xe = $this->web->get(sfConfig::get('app_source_countries'), null, array('Cache-Control' => 'no-cache'));
     $doc = new DOMDocument();
     // It's rare you'll have valid XHTML, suppress any errors- it'll do its best.
     @$doc->loadhtml($xe->getResponseText());
     $xpath = new DOMXPath($doc);
     foreach ($xpath->query('/html/body//form//select[@name="From"]')->item(0)->getElementsByTagName('option') as $option) {
         $currency = Doctrine::getTable('Currency')->findOneByCode($option->getAttribute('value'));
         $name = substr($option->textContent, 0, strpos($option->textContent, ','));
         if ($currency instanceof Currency && !empty($name)) {
             $country = Doctrine::getTable('Country')->findOneByName($name);
             if (!$country instanceof Country) {
                 $country = new Country();
                 $country->setName($name);
             }
             $country->Currencies[] = $currency;
             $country->save();
         }
     }
 }
开发者ID:asaraf28,项目名称:CurrencyConverter,代码行数:21,代码来源:getCurrenciesTask.class.php

示例11: getDistributionTypes

 /**
  *
  * @param type $db - ADONewConnection
  * @param type $cropID - Crop ID to search from concepts table.
  * @return array - Array of DistributionType objects representing a geographical distribution.
  */
 public function getDistributionTypes($cropID)
 {
     global $db;
     $query = "SELECT Type FROM distribution WHERE Taxon_ID = " . $cropID . " AND Country IS NOT NULL GROUP BY Type ORDER BY Type ASC";
     $db_regionTypes = $db->getAll($query);
     $distributionTypes = array();
     foreach ($db_regionTypes as $db_regionType) {
         $distributionType = new DistributionType($db_regionType["Type"]);
         // search for Regions, countries and details.
         $query = "SELECT d.ID, c.Code, c.Name, c.Region, c.ISO_Alpha2,\n                        GROUP_CONCAT(dd.Detail SEPARATOR ', ') as Details\n                        FROM distribution d\n                        INNER JOIN countries c ON d.Country = c.Code\n                        LEFT JOIN distribution_detail dd ON d.Detail_ID = dd.ID\n                        WHERE d.Taxon_ID = " . $cropID . "\n                        AND d.Type = '" . $distributionType->getName() . "'\n                        group by c.Code\n                        ORDER BY c.Region, c.Code, dd.Detail";
         $db_regions = $db->getAll($query);
         $regions = array();
         $currentRegion = "";
         // loop regions
         foreach ($db_regions as $db_region) {
             if ($db_region["Region"] != $currentRegion) {
                 // Add last region. The variable $region must have been created before.
                 $currentRegion != "" ? array_push($regions, $region) : false;
                 $currentRegion = $db_region["Region"];
                 $region = new Region($currentRegion);
             }
             // create a country for the current region.
             $country = new Country($db_region["Code"]);
             $country->setName(trim($db_region["Name"]));
             $country->setIso2(trim($db_region["ISO_Alpha2"]));
             if (!empty($db_region["Details"])) {
                 // details are separated by commas, taked directly from the database.
                 $country->setDetails($db_region["Details"]);
             }
             $countries = $region->getCountries();
             array_push($countries, $country);
             $region->setCountries($countries);
         }
         array_push($regions, $region);
         $distributionType->setRegions($regions);
         // insert region type object to the array.
         array_push($distributionTypes, $distributionType);
     }
     return $distributionTypes;
 }
开发者ID:ralvarezpa,项目名称:gap-analysis-cwr,代码行数:46,代码来源:DistributionTypeMySQL.php

示例12: testToString

 /**
  * @dataProvider getNames
  */
 public function testToString($in, $out)
 {
     $this->assertSame($this->entity, $this->entity->setName($in));
     $this->assertSame($out, $this->entity->__toString());
 }
开发者ID:jlm-entreprise,项目名称:daily-bundle,代码行数:8,代码来源:PartFamilyTest.php

示例13: Country

<?php

require_once __DIR__ . "/../bootstrap.php";
require_once __DIR__ . "/AddUtils.php";
/* AddCountries.php: Loads a list of countries from an XML file and inserts them into
 * the doctrine prototype.
 */
$countriesFileName = __DIR__ . "/" . $GLOBALS['dataDir'] . "/Countries.xml";
$countries = simplexml_load_file($countriesFileName);
foreach ($countries as $country) {
    $doctrineCountry = new Country();
    $code = "";
    $name = "";
    foreach ($country as $key => $value) {
        if ($key == "name") {
            $code = (string) $value;
        }
        if ($key == "description") {
            $name = (string) $value;
        }
    }
    $doctrineCountry->setName($name);
    $doctrineCountry->setCode($code);
    $entityManager->persist($doctrineCountry);
}
$entityManager->flush();
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:26,代码来源:AddCountries.php

示例14: camp_html_breadcrumbs

    camp_html_display_error($translator->trans('Invalid security token!'));
    exit;
}
if (!$g_user->hasPermission('ManageCountries')) {
    camp_html_display_error($translator->trans("You do not have the right to change country names.", array(), 'country'));
    exit;
}
$f_country_code = Input::Get('f_country_code');
$f_country_language = Input::Get('f_country_language');
$f_country_name = trim(Input::Get('f_country_name'));
$country = new Country($f_country_code, $f_country_language);
$language = new Language($f_country_language);
if (empty($f_country_name)) {
    $errorMsgs[] = $translator->trans("You must fill in the \$1 field.", array('$1' => "<B>" . $translator->trans("Name") . "</B>"));
} else {
    if ($country->setName($f_country_name)) {
        camp_html_goto_page("/{$ADMIN}/country/index.php");
    } else {
        $errorMsgs[] = $translator->trans('The country name $1 could not be changed', array('$1' => '<B>' . htmlspecialchars($country->getName()) . '</B>'), 'country');
    }
}
$crumbs = array();
$crumbs[] = array($translator->trans("Configure"), "");
$crumbs[] = array($translator->trans("Countries"), "/{$ADMIN}/country/");
$crumbs[] = array($translator->trans("Changing country name", array(), 'country'), "");
echo camp_html_breadcrumbs($crumbs);
?>

<P>
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="8" class="message_box">
<TR>
开发者ID:sourcefabric,项目名称:newscoop,代码行数:31,代码来源:do_edit.php

示例15: testGetSetName

 public function testGetSetName()
 {
     $this->country->setName('GREAT BRITAIN');
     $this->assertEquals('GREAT BRITAIN', $this->country->getName());
 }
开发者ID:delboy1978uk,项目名称:country,代码行数:5,代码来源:CountryTest.php


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