SpecPrice   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A product() 0 4 1
A improvedSpecs() 0 4 1
1
<?php
2
3
namespace App;
4
use App\Libraries\Metaable\HasMeta;
5
use Keyhunter\Administrator\Repository;
6
use Illuminate\Database\Eloquent\Builder;
7
use App\Libraries\Presenterable\Presenterable;
8
use App\Libraries\Presenterable\Presenters\SpecPricePresenter;
9
class SpecPrice extends Repository
10
{
11
    use HasMeta, Presenterable;
12
    /**
13
     * @var string
14
     */
15
    protected $table = 'product_specifications_price';
16
17
    /**
18
     * @var array
19
     */
20
    protected $fillable = ['lot_id','product_id','new_price','old_price','sale','name'];
21
22
    protected $presenter = SpecPricePresenter::class;
23
24
    /**
25
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
26
     */
27
    public function product()
28
    {
29
        return $this->belongsTo(Product::class, 'product_id', 'id');
30
    }
31
32
    public function improvedSpecs()
33
    {
34
        return $this->hasMany(ImprovedSpec::class, 'price_spec_id', 'id');
35
    }
36
37
    /**
38
     * @var bool
39
     */
40
    public $timestamps = false;
41
}