本文整理汇总了PHP中app\models\Country::getTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::getTableName方法的具体用法?PHP Country::getTableName怎么用?PHP Country::getTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Country
的用法示例。
在下文中一共展示了Country::getTableName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCountry
public function addCountry(Country $country)
{
$countCountries = $this->getCountriesBy(Country::getTableName() . '.code', $country->code)->count();
if ($countCountries == 0) {
$this->getCountries()->attach($country->id);
}
$this->flushCacheByTags('CarriersCountries');
}
示例2: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shipment_carriers_countries', function (Blueprint $table) {
$table->bigInteger('carrier_id')->unsigned();
$table->bigInteger('country_id')->unsigned();
$table->foreign('carrier_id')->references('id')->on(Carrier::getTableName())->onDelete('cascade');
$table->foreign('country_id')->references('id')->on(Country::getTableName())->onDelete('cascade');
$table->primary(['carrier_id', 'country_id']);
});
}
开发者ID:e-tipalchuk,项目名称:lumen-shipment-service,代码行数:15,代码来源:2015_09_04_180047_create_shipmment_carriers_countries_table.php
示例3: down
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
if (Schema::hasTable(Country::getTableName())) {
Schema::drop(Country::getTableName());
}
}
开发者ID:e-tipalchuk,项目名称:lumen-shipment-service,代码行数:11,代码来源:2015_09_02_163604_create_countries_table.php