Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
GSActorToAttachment | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
7 | |
100.00% |
1 / 1 |
setAttachmentId | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getAttachmentId | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setGSActorId | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getGSActorId | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setModified | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getModified | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
schemaDef | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
1 | <?php |
2 | |
3 | // {{{ License |
4 | // This file is part of GNU social - https://www.gnu.org/software/social |
5 | // |
6 | // GNU social is free software: you can redistribute it and/or modify |
7 | // it under the terms of the GNU Affero General Public License as published by |
8 | // the Free Software Foundation, either version 3 of the License, or |
9 | // (at your option) any later version. |
10 | // |
11 | // GNU social is distributed in the hope that it will be useful, |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | // GNU Affero General Public License for more details. |
15 | // |
16 | // You should have received a copy of the GNU Affero General Public License |
17 | // along with GNU social. If not, see <http://www.gnu.org/licenses/>. |
18 | // }}} |
19 | |
20 | namespace App\Entity; |
21 | |
22 | use App\Core\Entity; |
23 | use DateTimeInterface; |
24 | |
25 | /** |
26 | * Entity for relating an actor to an attachment |
27 | * |
28 | * @category DB |
29 | * @package GNUsocial |
30 | * |
31 | * @author Diogo Peralta Cordeiro <mail@diogo.site> |
32 | * @copyright 2021 Free Software Foundation, Inc http://www.fsf.org |
33 | * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later |
34 | */ |
35 | class GSActorToAttachment extends Entity |
36 | { |
37 | // {{{ Autocode |
38 | // @codeCoverageIgnoreStart |
39 | private int $attachment_id; |
40 | private int $gsactor_id; |
41 | private \DateTimeInterface $modified; |
42 | |
43 | public function setAttachmentId(int $attachment_id): self |
44 | { |
45 | $this->attachment_id = $attachment_id; |
46 | return $this; |
47 | } |
48 | |
49 | public function getAttachmentId(): int |
50 | { |
51 | return $this->attachment_id; |
52 | } |
53 | |
54 | public function setGSActorId(int $gsactor_id): self |
55 | { |
56 | $this->gsactor_id = $gsactor_id; |
57 | return $this; |
58 | } |
59 | |
60 | public function getGSActorId(): int |
61 | { |
62 | return $this->gsactor_id; |
63 | } |
64 | |
65 | public function setModified(DateTimeInterface $modified): self |
66 | { |
67 | $this->modified = $modified; |
68 | return $this; |
69 | } |
70 | |
71 | public function getModified(): DateTimeInterface |
72 | { |
73 | return $this->modified; |
74 | } |
75 | |
76 | // @codeCoverageIgnoreEnd |
77 | // }}} Autocode |
78 | |
79 | public static function schemaDef(): array |
80 | { |
81 | return [ |
82 | 'name' => 'gsactor_to_attachment', |
83 | 'fields' => [ |
84 | 'attachment_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Attachment.id', 'multiplicity' => 'one to one', 'name' => 'attachment_to_note_attachment_id_fkey', 'not null' => true, 'description' => 'id of attachment'], |
85 | 'gsactor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'one to one', 'name' => 'attachment_to_note_note_id_fkey', 'not null' => true, 'description' => 'id of the note it belongs to'], |
86 | 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], |
87 | ], |
88 | 'primary key' => ['attachment_id', 'gsactor_id'], |
89 | 'indexes' => [ |
90 | 'attachment_id_idx' => ['attachment_id'], |
91 | 'gsactor_id_idx' => ['gsactor_id'], |
92 | ], |
93 | ]; |
94 | } |
95 | } |