本文整理匯總了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