Completed
Push — master ( 5e49b6...2ab591 )
by David Martínez
07:18
created

Timeslot   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 3
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A shifts() 0 4 1
A lessons() 0 4 1
1
<?php
2
3
namespace Scool\Timetables\Models;
4
5
use Acacha\Names\Traits\Nameable;
6
use Illuminate\Database\Eloquent\Model;
7
8
9
/**
10
 * Class Timeslot
11
 * @package Scool\Timetables\Models
12
 */
13
class Timeslot extends Model
14
{
15
    use Nameable;
16
17
    protected $fillable = [
18
         'name', 'init_hour', 'final_hour'
19
    ];
20
21
    /**
22
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
23
     */
24
    public function shifts()
25
    {
26
        return $this->belongsToMany(Shift::class)->withTimestamps();
27
    }
28
29
    public function lessons()
30
    {
31
        return $this->hasMany(\Scool\Timetables\Models\Lesson::class);
32
    }
33
}
34