Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
SmsCarrier | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
11 | |
100.00% |
1 / 1 |
setId | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getId | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setName | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getName | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
setEmailPattern | n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||||
getEmailPattern | 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 SMS carriers |
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 SmsCarrier extends Entity |
40 | { |
41 | // {{{ Autocode |
42 | // @codeCoverageIgnoreStart |
43 | private int $id; |
44 | private ?string $name; |
45 | private string $email_pattern; |
46 | private \DateTimeInterface $created; |
47 | private \DateTimeInterface $modified; |
48 | |
49 | public function setId(int $id): self |
50 | { |
51 | $this->id = $id; |
52 | return $this; |
53 | } |
54 | |
55 | public function getId(): int |
56 | { |
57 | return $this->id; |
58 | } |
59 | |
60 | public function setName(?string $name): self |
61 | { |
62 | $this->name = $name; |
63 | return $this; |
64 | } |
65 | |
66 | public function getName(): ?string |
67 | { |
68 | return $this->name; |
69 | } |
70 | |
71 | public function setEmailPattern(string $email_pattern): self |
72 | { |
73 | $this->email_pattern = $email_pattern; |
74 | return $this; |
75 | } |
76 | |
77 | public function getEmailPattern(): string |
78 | { |
79 | return $this->email_pattern; |
80 | } |
81 | |
82 | public function setCreated(DateTimeInterface $created): self |
83 | { |
84 | $this->created = $created; |
85 | return $this; |
86 | } |
87 | |
88 | public function getCreated(): DateTimeInterface |
89 | { |
90 | return $this->created; |
91 | } |
92 | |
93 | public function setModified(DateTimeInterface $modified): self |
94 | { |
95 | $this->modified = $modified; |
96 | return $this; |
97 | } |
98 | |
99 | public function getModified(): DateTimeInterface |
100 | { |
101 | return $this->modified; |
102 | } |
103 | |
104 | // @codeCoverageIgnoreEnd |
105 | // }}} Autocode |
106 | |
107 | public static function schemaDef(): array |
108 | { |
109 | return [ |
110 | 'name' => 'sms_carrier', |
111 | 'fields' => [ |
112 | 'id' => ['type' => 'int', 'not null' => true, 'description' => 'primary key for SMS carrier'], |
113 | 'name' => ['type' => 'varchar', 'length' => 64, 'description' => 'name of the carrier'], |
114 | 'email_pattern' => ['type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'sprintf pattern for making an email address from a phone number'], |
115 | 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], |
116 | 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], |
117 | ], |
118 | 'primary key' => ['id'], |
119 | 'unique keys' => [ |
120 | 'sms_carrier_name_key' => ['name'], |
121 | ], |
122 | ]; |
123 | } |
124 | } |