| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentCart\App\Models; |
| 4 |
|
| 5 |
/** |
| 6 |
* Attributes Relations Model - DB Model for Attributes Terms to Specific Variations |
| 7 |
* Maybe we don't need this model. For now, it's here |
| 8 |
* |
| 9 |
* Database Model |
| 10 |
* |
| 11 |
* @package FluentCart\App\Models |
| 12 |
* |
| 13 |
* @version 1.0.0 |
| 14 |
*/ |
| 15 |
class AttributeRelation extends Model |
| 16 |
{ |
| 17 |
protected $table = 'fct_atts_relations'; |
| 18 |
|
| 19 |
protected $fillable = [ |
| 20 |
'group_id', |
| 21 |
'term_id', |
| 22 |
'object_id', |
| 23 |
]; |
| 24 |
|
| 25 |
public function group() |
| 26 |
{ |
| 27 |
return $this->belongsTo(AttributeGroup::class, 'group_id', 'id'); |
| 28 |
} |
| 29 |
|
| 30 |
public function term() |
| 31 |
{ |
| 32 |
return $this->belongsTo(AttributeTerm::class, 'term_id', 'id'); |
| 33 |
} |
| 34 |
|
| 35 |
public function productDetails() |
| 36 |
{ |
| 37 |
return $this->belongsTo(ProductDetail::class, 'object_id', 'id'); |
| 38 |
} |
| 39 |
} |
| 40 |
|