本文整理汇总了PHP中Country::setReexport方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::setReexport方法的具体用法?PHP Country::setReexport怎么用?PHP Country::setReexport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Country
的用法示例。
在下文中一共展示了Country::setReexport方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
示例2: Country
if(RequestsPatterns::postParamsSetted('name', 'type')){
if(RequestsPatterns::postParamsSent('name', 'type')){
$name = $_POST['name'];
$typeCountry = $_POST['type'];
$country = new Country($name);
$dao = new GenericDao(Connection::connect());
$controller = new Controller($dao);
$message = "País inserido com sucesso";
$message_error = "Falha na inserção do país";
try{
if($typeCountry == 'origin'){
if(isset($_POST['reexport']) && $_POST['reexport'] == true){
$country->setReexport();
}
if($controller->createNewOriginCountry($country)){
$countryToCache = $controller->getCountryByName($country,$typeCountry);
cacheCountry($countryToCache, $typeCountry);
print_r($json->response (true, $message)->serialize ());
}else
print_r($json->response (true, $message_error)->serialize ());
}else{
if($controller->createNewDestinyCountry($country)){
$countryToCache = $controller->getCountryByName($country,$typeCountry);
cacheCountry($countryToCache, $typeCountry);
print_r($json->response (true, $message)->serialize ());
}else
print_r($json->response (true, $message_error)->serialize ());
}
示例3: buildObject
private function buildObject($type, $object)
{
if (isset($object['name'])) {
$name = utf8_encode($object['name']);
}
$id = $object['id'];
switch ($type) {
case "area":
return new Area($object['name'], $object['id']);
break;
case "subarea":
return new SubArea($object['name'], $object['id']);
break;
case "estados":
return new State($object['id'], $object['uf'], $object['nome']);
break;
case "city":
return new City($object['nome'], $object['id']);
break;
case "activities":
return new Activity($object['name'], $object['id']);
break;
case "publication_type":
return new PublicationType($object['name'], $object['id']);
break;
case "groups":
return new Group($name, $id);
break;
case "subgroup":
return new Subgroup($name, $id);
break;
case "variety":
return new Variety($name, $id);
break;
case "coffetype":
return new CoffeType($name, $id);
break;
case "country":
$country = new Country($name, $id);
if (isset($object['reexport']) && $object['reexport'] == 1) {
$country->setReexport();
}
return $country;
break;
case "font":
return new Font($name, $id);
break;
}
}