1 | <?php |
||
39 | class Attachment extends ModelAbstract |
||
40 | { |
||
41 | use AttachmentRelations, AttachmentScopes; |
||
42 | |||
43 | /** |
||
44 | * Timestamp enabled. |
||
45 | * |
||
46 | * @var bool |
||
47 | */ |
||
48 | public $timestamps = true; |
||
49 | |||
50 | /** |
||
51 | * Name of database table. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $table = 'projects_issues_attachments'; |
||
56 | |||
57 | /** |
||
58 | * List of allowed columns to be used in $this->fill(). |
||
59 | * |
||
60 | * @var array |
||
61 | */ |
||
62 | protected $fillable = [ |
||
63 | 'uploaded_by', |
||
64 | 'filename', |
||
65 | 'fileextension', |
||
66 | 'filesize', |
||
67 | 'upload_token', |
||
68 | ]; |
||
69 | |||
70 | /** |
||
71 | * @param User|null $user |
||
72 | * |
||
73 | * @return \Tinyissue\Repository\Project\Issue\Attachment\Updater |
||
74 | */ |
||
75 | public function updater(User $user = null) |
||
79 | |||
80 | /** |
||
81 | * Whether or not the file extension is supported image type. |
||
82 | * |
||
83 | * @return bool |
||
84 | */ |
||
85 | public function isImage() |
||
98 | |||
99 | /** |
||
100 | * Url to attachment download. |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | public function download() |
||
108 | |||
109 | /** |
||
110 | * Url to display attachment. |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | public function display() |
||
118 | |||
119 | /** |
||
120 | * Generate a URL to delete attachment. |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | public function toDelete() |
||
128 | } |
||
129 |