Completed
Push — master ( 1cb7f3...033b4b )
by Daniel Rodrigues
05:09
created

WorkoutPlan   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 4 1
A workoutType() 0 4 1
1
<?php
2
3
namespace API\Models;
4
5
use API\Traits\UuidTrait;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\SoftDeletes;
8
9
class WorkoutPlan extends Model
10
{
11
    use UuidTrait;
12
    use SoftDeletes;
13
14
    protected $table = 'workout_plan';
15
    protected $primaryKey = 'id';
16
17
    protected $fillable = [
18
        'uuid', 'fk_workout_type', 'fk_user'
19
    ];
20
21
    protected $dates = [
22
        'deleted_at'
23
    ];
24
25
    public function user()
26
    {
27
        return $this->belongsTo('API\Models\User', 'fk_user');
28
    }
29
30
    public function workoutType()
31
    {
32
        return $this->belongsTo('API\Models\WorkoutType', 'fk_workout_type');
33
    }
34
35
}