Test Setup Failed
Push — development ( ce0609...d418a4 )
by Tim
08:46
created

TasksRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 3
Bugs 1 Features 1
Metric Value
wmc 2
c 3
b 1
f 1
lcom 0
cbo 1
dl 0
loc 44
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A assignee() 0 4 1
A requestUser() 0 4 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class TasksRequest
9
 * @package App
10
 */
11
class TasksRequest extends Model
12
{
13
    /**
14
     * Mass assign fields.
15
     *
16
     * @var array
17
     */
18
    protected $fillable = [
19
        'requester', 'userid', 'type', 'status',
20
        'startdate', 'enddate', 'description'];
21
22
    /**
23
     * Hidden fields
24
     *
25
     * @var array
26
     */
27
    protected $hidden = ['created_at', 'updated_at'];
28
29
    /**
30
     * The database table used by the model.
31
     *
32
     * @var string
33
     */
34
    protected $table = 'tasks_requests';
35
36
    /**
37
     * TASK -> USER REQUEST. TO DETERMOINE HO IS ASSIGNED
38
     *
39
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
40
     */
41
    public function assignee()
42
    {
43
        return $this->belongsTo('App\User', 'userid', 'id');
44
    }
45
46
    /**
47
     * TASK -> REQUESTER to see the data who request this tasks.
48
     *
49
     */
50
    public function requestUser()
51
    {
52
        return $this->belongsTo('App\User', 'requester', 'id');
53
    }
54
}
55