当前位置: 首页>>代码示例>>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;未经允许,请勿转载。