Completed
Branch develop-3.0 (48060b)
by Mohamed
02:47
created

Note::updater()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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 Tinyissue\Model;
16
use Tinyissue\Model\ModelAbstract;
17
18
/**
19
 * Note is model class for project notes.
20
 *
21
 * @author Mohamed Alsharaf <[email protected]>
22
 *
23
 * @property int $id
24
 * @property int $project_id
25
 * @property int $created_by
26
 * @property string $body
27
 * @property Model\Project $project
28
 * @property Model\User $createdBy
29
 * @property Model\User\Activity $activity
30
 * @property Collection $messagesQueue
31
 */
32
class Note extends ModelAbstract
33
{
34
    use NoteRelations;
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
     * @param Model\User|null $user
59
     *
60
     * @return \Tinyissue\Repository\Project\Note\Updater
61
     */
62
    public function updater(Model\User $user = null)
63
    {
64
        return parent::updater($user);
65
    }
66
67
    /**
68
     * Generate a URL for the project note.
69
     *
70
     * @return string
71
     */
72
    public function to()
73
    {
74
        return \URL::to('project/' . $this->project->id . '/notes#note' . $this->id);
75
    }
76
}
77