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
|
|
|
|