Test Failed
Push — master ( befccc...a4b299 )
by Gianluca
19:49
created

ProductItem   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 6
c 1
b 0
f 0
dl 0
loc 18
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A details() 0 2 1
A product() 0 2 1
A configurationFields() 0 2 1
A category() 0 2 1
1
<?php
2
3
4
namespace Mongi\Mongicommerce\Models;
5
6
7
use Illuminate\Database\Eloquent\Factories\HasFactory;
8
use Illuminate\Database\Eloquent\Model;
9
10
class ProductItem extends Model
11
{
12
    use HasFactory;
13
14
    public function details(){
15
        return $this->hasMany(ProductItemDetail::class,'product_item_id');
16
    }
17
18
    public function configurationFields(){
19
        return $this->hasMany(ProductConfigurationField::class,'product_item_id');
20
    }
21
22
    public function product(){
23
        return $this->belongsTo(Product::class);
24
    }
25
26
    public function category(){
27
        return $this->belongsTo(Category::class);
28
    }
29
30
}
31