Completed
Pull Request — master (#83)
by D.
10:45 queued 08:12
created

TrainingType::trainings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace SET;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class TrainingType extends Model
8
{
9
    /**
10
   * @var string
11
   */
12
  protected $table = 'training_types';
13
  /**
14
   * @var bool
15
   */
16
  public $timestamps = true;
17
  /**
18
   * @var array
19
   */
20
  protected $fillable = ['name', 'description', 'sidebar', 'status'];
21
  /**
22
   * @var array
23
   */
24
  protected $dates = ['created_at', 'updated_at'];
25
26
  /**
27
   * Get the trainings that have the training type.
28
   */
29 1
  public function trainings()
30
  {
31 1
      return $this->hasMany('SET\Training', 'training_type_id'); // One To Many
32
  }
33
}
34