Timeslot   A
last analyzed

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
 * Class Timeslot
10
 * @package Scool\Timetables\Models
11
 */
12
class Timeslot extends Model
13
{
14
    use Nameable;
15
16
    protected $fillable = [
17
         'name', 'init_hour', 'final_hour'
18
    ];
19
20
    /**
21
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
22
     */
23
    public function shifts()
24
    {
25
        return $this->belongsToMany(Shift::class)->withTimestamps();
26
    }
27
28
    public function lessons()
29
    {
30
        return $this->hasMany(\Scool\Timetables\Models\Lesson::class);
31
    }
32
}
33