本文整理汇总了PHP中Country类的典型用法代码示例。如果您正苦于以下问题:PHP Country类的具体用法?PHP Country怎么用?PHP Country使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Country类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testTranslate
public function testTranslate()
{
$c = new Country();
$c->setDataSourceDir(SOURCE_DIR);
$c->setLang('en');
$this->assertEquals('Sweden', $c->translate('se'));
}
示例2: manageArmy
private function manageArmy(Army $army, Country $country)
{
if ($country->isFree()) {
return;
}
$army->increaseSize();
}
示例3: createCountry
public function createCountry($name)
{
$tmp = new Country();
$tmp->name = $name;
$tmp->save();
return $tmp;
}
示例4: getCountry
/**
* For listing the Country
* @author Praveen Singh
* @method getCountry
* @param $module_id,$group_id
* @return one row of Module Role table
* @since version 0.0.1
* @version 0.2.9
*/
function getCountry($cntId)
{
App::import("Model", "Country");
$model = new Country();
$datas = $model->find("first", array('conditions' => array('Country.id' => $cntId)));
return $datas;
}
示例5: actionModel
public function actionModel()
{
$country = new Country();
// $validate = $country->getValidators();
$meta = $country->getMetaData();
var_dump($meta);
}
示例6: factory
public static function factory(Storage $storage, $row)
{
$country = new Country($storage);
$country->setCountryID($row["countryid"]);
$country->setLabel($row["label"]);
return $country;
}
示例7: CityList
public function CityList($cuntry_id)
{
$h = new Country();
echo json_encode($h->CityList($cuntry_id));
// or render View
return TRUE;
}
示例8: get
public function get()
{
$uid = (int) $_REQUEST['uid'];
if ($uid == 0) {
$uid = $this->user->id;
}
$user = new User();
$user->get($uid);
$userData = $user->getRaw();
//region data
$region = new Region();
$regionData = $region->getRaw($userData['region']);
$userData['region'] = array('id' => $regionData['id'], 'name' => $regionData['name']);
//counrry data
$country = new Country();
$countryData = $country->getRaw($userData['country']);
$userData['country'] = array('id' => $countryData['id'], 'name' => $countryData['name']);
// myself
if ($uid == $this->user->id) {
$currencyQuantity = $user->getCurrency($userData['currency']);
$userData['currencyName'] = $userData['currency'];
$userData['currency'] = $currencyQuantity;
} else {
unset($userData['gold']);
unset($userData['currency']);
}
unset($userData['password']);
return $userData;
}
示例9: construct
public static function construct($array)
{
$obj = new Country();
$obj->setName($array['name']);
$obj->setCode($array['code']);
$obj->setStates($array['states']);
return $obj;
}
示例10: testCountry
public function testCountry()
{
$country = new Country('au');
$this->assertEquals('AU', $country->getCountryCode());
$country = new Country('AU');
$this->assertEquals('AU', $country->getCountryCode());
$this->assertEquals('Australia', $country->getCountryName());
}
示例11: actionAdmin
public function actionAdmin()
{
$model = new Country('search');
$model->unsetAttributes();
if (isset($_GET['Country'])) {
$model->setAttributes($_GET['Country']);
}
$this->render('admin', array('model' => $model));
}
示例12: actionAdmin
public function actionAdmin()
{
$this->getMaxSorter();
$this->getMinSorter();
$this->rememberPage();
$model = new Country('search');
$model->setRememberScenario('country_remember');
$this->render('admin', array_merge(array('model' => $model), $this->params));
}
示例13: get
function get($Code)
{
$parametros = array();
$parametros['Code'] = $Code;
$this->bd->select($this->tabla, '*', "Code=:Code", $parametros);
$fila = $this->bd->getRow();
$country = new Country();
$country->set($fila);
return $country;
}
示例14: postCountry
public function postCountry()
{
$posted = Input::get();
$country = new Country();
$country->country_name = $posted['country_name'];
$country->category_id = $posted['category_id'];
$country->category_name = $posted['category_name'];
$country->save();
return Redirect::back()->with('success', 'Country has been created');
}
示例15: all
function all()
{
$this->is_loggedin();
$this->title = "Countries";
$this->message = "BeBuntu Countries";
$all_countries = new Country();
pass_var('all_countries', $all_countries->find_all());
pass_var('title', $this->title);
pass_var('message', $this->message);
}