本文整理匯總了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;
}
示例2: testGetSetId
public function testGetSetId()
{
$this->country->setId('GBR');
$this->assertEquals('GBR', $this->country->getId());
}
示例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);
}
示例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());
}
示例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());
}