Note::to()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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\Collection;
15
use Illuminate\Database\Eloquent\Model as BaseModel;
16
use Tinyissue\Model;
17
use Tinyissue\Model\Traits\Project\Note\CrudTrait;
18
use Tinyissue\Model\Traits\Project\Note\RelationTrait;
19
use Tinyissue\Model\Traits\Project\Note\QueueTrait;
20
21
/**
22
 * Note is model class for project notes.
23
 *
24
 * @author Mohamed Alsharaf <[email protected]>
25
 *
26
 * @property int $id
27
 * @property int $project_id
28
 * @property int $created_by
29
 * @property string $body
30
 * @property Model\Project $project
31
 * @property Model\User $createdBy
32
 * @property Model\User\Activity $activity
33
 * @property Collection $messagesQueue
34
 */
35
class Note extends BaseModel
36
{
37
    use CrudTrait,
38
        RelationTrait,
39
        QueueTrait;
40
41
    /**
42
     * Timestamp enabled.
43
     *
44
     * @var bool
45
     */
46
    public $timestamps = true;
47
48
    /**
49
     * Name of database table.
50
     *
51
     * @var string
52
     */
53
    protected $table = 'projects_notes';
54
55
    /**
56
     * List of allowed columns to be used in $this->fill().
57
     *
58
     * @var array
59
     */
60
    protected $fillable = ['project_id', 'created_by', 'body'];
61
62
    /**
63
     * Generate a URL for the project note.
64
     *
65
     * @return string
66
     */
67 2
    public function to()
68
    {
69 2
        return \URL::to('project/' . $this->project->id . '/notes#note' . $this->id);
70
    }
71
}
72