Completed
Push — develop ( f7252d...97603d )
by Mohamed
04:44
created

Note   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 5
Bugs 2 Features 2
Metric Value
wmc 1
c 5
b 2
f 2
lcom 1
cbo 5
dl 0
loc 36
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A to() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Tinyissue package.
5
 *
6
 * (c) Mohamed Alsharaf <[email protected]>
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
namespace Tinyissue\Model\Project;
13
14
use Illuminate\Database\Eloquent\Model as BaseModel;
15
use Tinyissue\Model;
16
use Tinyissue\Model\Traits\Project\Note\CrudTrait;
17
use Tinyissue\Model\Traits\Project\Note\RelationTrait;
18
19
/**
20
 * Note is model class for project notes
21
 *
22
 * @author Mohamed Alsharaf <[email protected]>
23
 *
24
 * @property int           $id
25
 * @property int           $project_id
26
 * @property int           $created_by
27
 * @property string        $body
28
 * @property Model\Project $project
29
 * @property Model\User    $createdBy
30
 */
31
class Note extends BaseModel
32
{
33
    use CrudTrait,
34
        RelationTrait;
35
36
    /**
37
     * Timestamp enabled
38
     *
39
     * @var bool
40
     */
41
    public $timestamps = true;
42
43
    /**
44
     * Name of database table
45
     *
46
     * @var string
47
     */
48
    protected $table = 'projects_notes';
49
50
    /**
51
     * List of allowed columns to be used in $this->fill()
52
     *
53
     * @var array
54
     */
55
    protected $fillable = ['project_id', 'created_by', 'body'];
56
57
    /**
58
     * Generate a URL for the project note
59
     *
60
     * @return string
61
     */
62
    public function to()
63
    {
64
        return \URL::to('project/' . $this->project->id . '/notes#note' . $this->id);
65
    }
66
}
67