]> git.mxchange.org Git - friendica.git/blob - src/Federation/Entity/GServer.php
HTML-escape notification contact names
[friendica.git] / src / Federation / Entity / GServer.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2023, the Friendica project
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Affero General Public License as
9  * published by the Free Software Foundation, either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Affero General Public License for more details.
16  *
17  * You should have received a copy of the GNU Affero General Public License
18  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19  *
20  */
21
22 namespace Friendica\Federation\Entity;
23
24 use DateTimeImmutable;
25 use Psr\Http\Message\UriInterface;
26
27 /**
28  * @property-read int                $id
29  * @property-read string             $url
30  * @property-read string             $nurl
31  * @property-read string             $version
32  * @property-read string             $siteName
33  * @property-read string             $info
34  * @property-read int                $registerPolicy
35  * @property-read int                $registeredUsers
36  * @property-read string             $poco
37  * @property-read string             $noscrape
38  * @property-read string             $network
39  * @property-read string             $platform
40  * @property-read int                $relaySubscribe
41  * @property-read string             $relayScope
42  * @property-read DateTimeImmutable  $created
43  * @property-read ?DateTimeImmutable $lastPocoQuery
44  * @property-read ?DateTimeImmutable $lastContact
45  * @property-read ?DateTimeImmutable $lastFailure
46  * @property-read int                $directoryType
47  * @property-read int                $detectionMethod
48  * @property-read bool               $failed
49  * @property-read DateTimeImmutable  $nextContact
50  * @property-read int                $protocol
51  * @property-read int                $activeWeekUsers
52  * @property-read int                $activeMonthUsers
53  * @property-read int                $activeHalfyearUsers
54  * @property-read int                $localPosts
55  * @property-read int                $localComments
56  * @property-read bool               $blocked
57  */
58 class GServer extends \Friendica\BaseEntity
59 {
60         /** @var ?int */
61         protected $id;
62         /** @var UriInterface */
63         protected $url;
64         /** @var UriInterface */
65         protected $nurl;
66         /** @var string */
67         protected $version;
68         /** @var string */
69         protected $siteName;
70         /** @var string */
71         protected $info;
72         /** @var int One of Module\Register::* constant values */
73         protected $registerPolicy;
74         /** @var int */
75         protected $registeredUsers;
76         /** @var ?UriInterface */
77         protected $poco;
78         /** @var ?UriInterface */
79         protected $noscrape;
80         /** @var string One of the Protocol::* constant values */
81         protected $network;
82         /** @var string */
83         protected $platform;
84         /** @var bool */
85         protected $relaySubscribe;
86         /** @var string */
87         protected $relayScope;
88         /** @var DateTimeImmutable */
89         protected $created;
90         /** @var DateTimeImmutable */
91         protected $lastPocoQuery;
92         /** @var DateTimeImmutable */
93         protected $lastContact;
94         /** @var DateTimeImmutable */
95         protected $lastFailure;
96         /** @var int One of Model\Gserver::DT_* constant values */
97         protected $directoryType;
98         /** @var ?int One of Model\Gserver::DETECT_* constant values */
99         protected $detectionMethod;
100         /** @var bool */
101         protected $failed;
102         /** @var DateTimeImmutable */
103         protected $nextContact;
104         /** @var ?int One of Model\Post\DeliveryData::* constant values */
105         protected $protocol;
106         /** @var ?int */
107         protected $activeWeekUsers;
108         /** @var ?int */
109         protected $activeMonthUsers;
110         /** @var ?int */
111         protected $activeHalfyearUsers;
112         /** @var ?int */
113         protected $localPosts;
114         /** @var ?int */
115         protected $localComments;
116         /** @var bool */
117         protected $blocked;
118
119         public function __construct(UriInterface $url, UriInterface $nurl, string $version, string $siteName, string $info, int $registerPolicy, int $registeredUsers, ?UriInterface $poco, ?UriInterface $noscrape, string $network, string $platform, bool $relaySubscribe, string $relayScope, DateTimeImmutable $created, ?DateTimeImmutable $lastPocoQuery, ?DateTimeImmutable $lastContact, ?DateTimeImmutable $lastFailure, int $directoryType, ?int $detectionMethod, bool $failed, ?DateTimeImmutable $nextContact, ?int $protocol, ?int $activeWeekUsers, ?int $activeMonthUsers, ?int $activeHalfyearUsers, ?int $localPosts, ?int $localComments, bool $blocked, ?int $id = null)
120         {
121                 $this->url                 = $url;
122                 $this->nurl                = $nurl;
123                 $this->version             = $version;
124                 $this->siteName            = $siteName;
125                 $this->info                = $info;
126                 $this->registerPolicy      = $registerPolicy;
127                 $this->registeredUsers     = $registeredUsers;
128                 $this->poco                = $poco;
129                 $this->noscrape            = $noscrape;
130                 $this->network             = $network;
131                 $this->platform            = $platform;
132                 $this->relaySubscribe      = $relaySubscribe;
133                 $this->relayScope          = $relayScope;
134                 $this->created             = $created;
135                 $this->lastPocoQuery       = $lastPocoQuery;
136                 $this->lastContact         = $lastContact;
137                 $this->lastFailure         = $lastFailure;
138                 $this->directoryType       = $directoryType;
139                 $this->detectionMethod     = $detectionMethod;
140                 $this->failed              = $failed;
141                 $this->nextContact         = $nextContact;
142                 $this->protocol            = $protocol;
143                 $this->activeWeekUsers     = $activeWeekUsers;
144                 $this->activeMonthUsers    = $activeMonthUsers;
145                 $this->activeHalfyearUsers = $activeHalfyearUsers;
146                 $this->localPosts          = $localPosts;
147                 $this->localComments       = $localComments;
148                 $this->blocked             = $blocked;
149                 $this->id                  = $id;
150         }
151 }