64 lines
1.8 KiB
PHP
64 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Products extends Model
|
|
{
|
|
public function pictograms() {
|
|
return $this->belongsToMany('App\Models\ProductPictograms', "products_pictograms", "id_product", "id_pictogram");
|
|
}
|
|
|
|
public function range() {
|
|
return $this->belongsTo('App\Models\Ranges', 'range_id');
|
|
}
|
|
|
|
public function meat_type() {
|
|
return $this->belongsTo('App\Models\MeatTypes', 'meat_type_id');
|
|
}
|
|
|
|
public function consumption_times() {
|
|
return $this->belongsTo('App\Models\ConsumptionTimes', 'consumption_times_id');
|
|
}
|
|
|
|
public function recipe() {
|
|
return $this->belongsTo('App\Models\Recipes', 'recipe_id');
|
|
}
|
|
|
|
public function country() {
|
|
return $this->belongsTo('App\Models\Countries', 'country_id');
|
|
}
|
|
|
|
public function society() {
|
|
return $this->belongsTo('App\Models\Societies', 'society_id');
|
|
}
|
|
|
|
public function sale_family() {
|
|
return $this->belongsTo('App\Models\SalesFamilies', 'sale_family_id');
|
|
}
|
|
|
|
public function inco_nutritional_values() {
|
|
return $this->hasOne('App\Models\INCONutritionalValues', 'product_id');
|
|
}
|
|
|
|
public function balanced_menu() {
|
|
return $this->hasOne('App\Models\BalancedMenus', 'product_id');
|
|
}
|
|
|
|
public function recipes_associated_1() {
|
|
return $this->hasMany('App\Models\Recipes', 'associated_product1');
|
|
}
|
|
|
|
public function recipes_associated_2() {
|
|
return $this->hasMany('App\Models\Recipes', 'associated_product2');
|
|
}
|
|
|
|
public function customers() {
|
|
return $this->belongsToMany('App\Models\Customers', 'cart', 'product_id', 'customer_id');
|
|
}
|
|
|
|
public function products() {
|
|
return $this->belongsToMany('App\Models\Reductions', 'reduction_config', 'product_id', 'reduction_id');
|
|
}
|
|
}
|