Completed
Pull Request — master (#46)
by Phecho
03:24
created

Member   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getPresenterClass() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Gitamin.
5
 * 
6
 * Copyright (C) 2015-2016 The Gitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
# == Schema Information
13
#
14
# Table name: members
15
#
16
#  id                 :integer          not null, primary key
17
#  access_level       :integer          not null
18
#  source_id          :integer          not null
19
#  source_type        :string(255)      not null
20
#  user_id            :integer
21
#  notification_level :integer          not null
22
#  type               :string(255)
23
#  created_at         :datetime
24
#  updated_at         :datetime
25
#  created_by_id      :integer
26
#  invite_email       :string(255)
27
#  invite_token       :string(255)
28
#  invite_accepted_at :datetime
29
#
30
31
namespace Gitamin\Models;
32
33
use AltThree\Validator\ValidatingTrait;
34
use Gitamin\Presenters\IssuePresenter;
35
use Illuminate\Database\Eloquent\Model;
36
use Illuminate\Database\Eloquent\SoftDeletes;
37
use McCool\LaravelAutoPresenter\HasPresenter;
38
39
class Member extends Model implements HasPresenter
40
{
41
    use ValidatingTrait;
42
43
    /**
44
     * The attributes that should be casted to native types.
45
     *
46
     * @var string[]
47
     */
48
    protected $casts = [
49
        'access_level'       => 'int',
50
        'source_id'    		 => 'int',
51
        'source_type'    	 => 'string',
52
        'user_id' 			 => 'int',
53
        'notification_level' => 'int',
54
        'type'    		 	 => 'string',
55
        'created_by_id' 	 => 'int',
56
    ];
57
58
    /**
59
     * The fillable properties.
60
     *
61
     * @var string[]
62
     */
63
    protected $fillable = [
64
        'access_level',
65
        'source_id',
66
        'source_type',
67
        'notification_level',
68
        'type',
69
    ];
70
71
    /**
72
     * The validation rules.
73
     *
74
     * @var string[]
75
     */
76
    public $rules = [
77
        'source_id'     => 'required|string',
78
        'source_type'   => 'required|string',
79
        'user_id'       => 'int',
80
        'type'          => 'string',
81
        'created_by_id' => 'int',
82
    ];
83
84
    /**
85
     * Get the presenter class.
86
     *
87
     * @return string
88
     */
89
    public function getPresenterClass()
90
    {
91
        return IssuePresenter::class;
92
    }
93
}
94