本文整理汇总了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());
}