當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Country::setId方法代碼示例

本文整理匯總了PHP中Country::setId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Country::setId方法的具體用法?PHP Country::setId怎麽用?PHP Country::setId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Country的用法示例。


在下文中一共展示了Country::setId方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: testGetSetId

 public function testGetSetId()
 {
     $this->country->setId('GBR');
     $this->assertEquals('GBR', $this->country->getId());
 }
開發者ID:delboy1978uk,項目名稱:country,代碼行數:5,代碼來源:CountryTest.php

示例3: buildDataToInsert

 private function buildDataToInsert($year, $subgroupId, $fontId, $typeId, $varietyId, $originId, $destinyId)
 {
     $font = new Font();
     $font->setId($fontId);
     $type = new CoffeType();
     $type->setId($typeId);
     $variety = new Variety();
     $variety->setId($varietyId);
     $origin = new Country();
     $origin->setId($originId);
     $destiny = new Country();
     $destiny->setId($destinyId);
     $subgroup = new Subgroup();
     $subgroup->setId($subgroupId);
     return new Data($year, $subgroup, $font, $type, $variety, $origin, $destiny);
 }
開發者ID:raigons,項目名稱:bureauinteligencia,代碼行數:16,代碼來源:DatacenterService.php

示例4: Country

<?php

require_once '../core/generics/Param.php';
require_once '../core/generics/datacenter/Country.php';
require_once '../core/generics/Controller.php';
require_once '../core/generics/GenericDao.php';
$id_country = $_POST['id'];
$country = new Country();
$country->setId($id_country);
$json = new JsonResponse();
$dao = new GenericDao(Connection::connect());
$controller = new Controller($dao);
try {
    if ($controller->deleteCountry($country)) {
        print_r($json->response(true, "País excluído com sucesso!")->serialize());
    } else {
        print_r($json->response(false, "Falha ao excluir o país.")->serialize());
    }
} catch (Exception $err) {
    print_r($json->response(false, $err->getMessage())->serialize());
}
開發者ID:raigons,項目名稱:bureauinteligencia,代碼行數:21,代碼來源:country_delete.php

示例5: JsonResponse

<?php

require_once '../core/generics/Param.php';
require_once '../core/generics/datacenter/Country.php';
require_once '../core/generics/Controller.php';
require_once '../core/generics/GenericDao.php';
$json = new JsonResponse();
$dao = new GenericDao(Connection::connect());
$controller = new Controller($dao);
$country_id = $_REQUEST['country'];
$object = new Country($_POST['name']);
$object->setId($country_id);
if (isset($_POST['reexport']) && $_POST['reexport'] == true) {
    $object->setReexport();
}
if ($controller->editCountry($object)) {
    print_r($json->response(true, "País editado com sucesso!")->serialize());
} else {
    print_r($json->response(false, "O país não foi editado!")->serialize());
}
開發者ID:raigons,項目名稱:bureauinteligencia,代碼行數:20,代碼來源:country_edit.php


注:本文中的Country::setId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。