Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
GSActorCircle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
13 | |
100.00% |
1 / 1 |
setTagger | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getTagger | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setTag | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getTag | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setDescription | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getDescription | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setPrivate | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getPrivate | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setCreated | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getCreated | 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 List of gsactors |
27 | * |
28 | * @category DB |
29 | * @package GNUsocial |
30 | * |
31 | * @author Zach Copley <zach@status.net> |
32 | * @copyright 2010 StatusNet Inc. |
33 | * @author Mikael Nordfeldth <mmn@hethane.se> |
34 | * @copyright 2009-2014 Free Software Foundation, Inc http://www.fsf.org |
35 | * @author Hugo Sales <hugo@hsal.es> |
36 | * @copyright 2020-2021 Free Software Foundation, Inc http://www.fsf.org |
37 | * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later |
38 | */ |
39 | class GSActorCircle extends Entity |
40 | { |
41 | // {{{ Autocode |
42 | // @codeCoverageIgnoreStart |
43 | private int $tagger; |
44 | private string $tag; |
45 | private ?string $description; |
46 | private ?bool $private; |
47 | private \DateTimeInterface $created; |
48 | private \DateTimeInterface $modified; |
49 | |
50 | public function setTagger(int $tagger): self |
51 | { |
52 | $this->tagger = $tagger; |
53 | return $this; |
54 | } |
55 | |
56 | public function getTagger(): int |
57 | { |
58 | return $this->tagger; |
59 | } |
60 | |
61 | public function setTag(string $tag): self |
62 | { |
63 | $this->tag = $tag; |
64 | return $this; |
65 | } |
66 | |
67 | public function getTag(): string |
68 | { |
69 | return $this->tag; |
70 | } |
71 | |
72 | public function setDescription(?string $description): self |
73 | { |
74 | $this->description = $description; |
75 | return $this; |
76 | } |
77 | |
78 | public function getDescription(): ?string |
79 | { |
80 | return $this->description; |
81 | } |
82 | |
83 | public function setPrivate(?bool $private): self |
84 | { |
85 | $this->private = $private; |
86 | return $this; |
87 | } |
88 | |
89 | public function getPrivate(): ?bool |
90 | { |
91 | return $this->private; |
92 | } |
93 | |
94 | public function setCreated(DateTimeInterface $created): self |
95 | { |
96 | $this->created = $created; |
97 | return $this; |
98 | } |
99 | |
100 | public function getCreated(): DateTimeInterface |
101 | { |
102 | return $this->created; |
103 | } |
104 | |
105 | public function setModified(DateTimeInterface $modified): self |
106 | { |
107 | $this->modified = $modified; |
108 | return $this; |
109 | } |
110 | |
111 | public function getModified(): DateTimeInterface |
112 | { |
113 | return $this->modified; |
114 | } |
115 | |
116 | // @codeCoverageIgnoreEnd |
117 | // }}} Autocode |
118 | |
119 | public static function schemaDef(): array |
120 | { |
121 | return [ |
122 | 'name' => 'gsactor_circle', |
123 | 'description' => 'a gsactor can have lists of gsactors, to separate their timeline', |
124 | 'fields' => [ |
125 | 'tagger' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'gsactor_list_tagger_fkey', 'not null' => true, 'description' => 'user making the tag'], |
126 | 'tag' => ['type' => 'varchar', 'length' => 64 //, 'foreign key' => true, 'target' => 'GSActorTag.tag', 'multiplicity' => 'many to one' // so, Doctrine doesn't like that the target is not unique, even though the pair is |
127 | , 'not null' => true, 'description' => 'gsactor tag', ], // Join with GSActorTag |
128 | 'description' => ['type' => 'text', 'description' => 'description of the people tag'], |
129 | 'private' => ['type' => 'bool', 'default' => false, 'description' => 'is this tag private'], |
130 | 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], |
131 | 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], |
132 | ], |
133 | 'primary key' => ['tagger', 'tag'], |
134 | 'indexes' => [ |
135 | 'gsactor_list_modified_idx' => ['modified'], |
136 | 'gsactor_list_tag_idx' => ['tag'], |
137 | 'gsactor_list_tagger_tag_idx' => ['tagger', 'tag'], |
138 | ], |
139 | ]; |
140 | } |
141 | } |