本文整理汇总了PHP中app\models\Country::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::className方法的具体用法?PHP Country::className怎么用?PHP Country::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Country
的用法示例。
在下文中一共展示了Country::className方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCountry
public function getCountry()
{
return $this->hasOne(Country::className(), ['ID' => 'CountryID']);
}
示例2: getCountry
public function getCountry()
{
return $this->hasMany(Country::className(), ['code' => 'code'])->via('countryFruits');
//->viaTable('country_fruits', ['id' => 'id']);
}
示例3: getCountries
/**
* @return \yii\db\ActiveQuery
*/
public function getCountries()
{
return $this->hasMany(Country::className(), ['updated_by' => 'user_id']);
}
示例4: getCountry
public function getCountry()
{
return $this->hasMany(Country::className(), ['id' => 'country_id'])->viaTable('country_org_rel', ['org_id' => 'id']);
}
示例5: getStateCountry
/**
* @return \yii\db\ActiveQuery
*/
public function getStateCountry()
{
return $this->hasOne(Country::className(), ['country_id' => 'state_country_id']);
}
示例6: getEmpCaddCountry
/**
* @return \yii\db\ActiveQuery
*/
public function getEmpCaddCountry()
{
return $this->hasOne(Country::className(), ['country_id' => 'emp_cadd_country']);
}
示例7: getCountries
/**
* @return \yii\db\ActiveQuery
*/
public function getCountries()
{
return $this->hasMany(Country::className(), ['id' => 'country_id'])->viaTable('timezone_country', ['timezone_id' => 'id'])->orderBy('{{country}}.[[key]]');
}
示例8: getCountryCode
/**
* @return \yii\db\ActiveQuery
*/
public function getCountryCode()
{
return $this->hasOne(Country::className(), ['Code' => 'CountryCode']);
}
示例9:
* Use existent form
* @var \yii\web\View $this
* @var \app\modules\shop\models\DeliveryInformation $deliveryInformation
* @var \app\modules\shop\models\OrderDeliveryInformation $orderDeliveryInformation
* @var boolean $immutable
* @var string $action
* @var \yii\bootstrap\ActiveForm $form
*/
?>
<h3><?php
echo Yii::t('app', 'Delivery information');
?>
</h3>
<?php
echo $form->field($deliveryInformation, 'country_id')->dropDownList(\app\components\Helper::getModelMap(\app\models\Country::className(), 'id', 'name'), ['readonly' => $immutable]);
?>
<?php
echo $form->field($deliveryInformation, 'city_id')->dropDownList(\app\components\Helper::getModelMap(\app\models\City::className(), 'id', 'name'), ['readonly' => $immutable]);
?>
<?php
echo $form->field($deliveryInformation, 'zip_code')->textInput(['readonly' => $immutable]);
?>
<?php
echo $form->field($deliveryInformation, 'address')->textarea(['readonly' => $immutable]);
?>
<?php
echo $form->field($orderDeliveryInformation, 'shipping_option_id')->dropDownList(\app\components\Helper::getModelMap(\app\modules\shop\models\ShippingOption::className(), 'id', 'name'), ['readonly' => $immutable]);
?>
示例10: getStuPaddCountry
/**
* @return \yii\db\ActiveQuery
*/
public function getStuPaddCountry()
{
return $this->hasOne(Country::className(), ['country_id' => 'stu_padd_country']);
}
示例11: getCountry
/**
* Получить страну пользователя
* @return Country
*/
public function getCountry()
{
if ($this->country_id) {
return $this->hasOne(Country::className(), ['id' => 'country_id']);
} else {
return new Country();
}
}