Passed
Push — develop ( dfa246...179c36 )
by Francisco
02:27
created

LogExchange   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A toStudent() 0 3 1
A fromStudent() 0 3 1
A fromShift() 0 3 1
A toShift() 0 3 1
1
<?php
2
3
namespace App\Judite\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class LogExchange extends Model
8
{
9
    /**
10
     * Get source shift of this logged exchange.
11
     *
12
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
13
     */
14
    public function fromShift()
15
    {
16
        return $this->belongsTo(Shift::class, 'from_shift_id');
17
    }
18
19
    /**
20
     * Get target shift of this logged exchange.
21
     *
22
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
23
     */
24
    public function toShift()
25
    {
26
        return $this->belongsTo(Shift::class, 'to_shift_id');
27
    }
28
29
    /**
30
     * Get source student of this logged exchange.
31
     *
32
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
33
     */
34
    public function fromStudent()
35
    {
36
        return $this->belongsTo(Student::class, 'from_student_id');
37
    }
38
39
    /**
40
     * Get target student of this logged exchange.
41
     *
42
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
43
     */
44
    public function toStudent()
45
    {
46
        return $this->belongsTo(Student::class, 'to_student_id');
47
    }
48
}
49