Completed
Push — develop ( e210c1...b7d5d2 )
by Mohamed
07:16 queued 59s
created

Note   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 100%

Importance

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

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