3 * @copyright Copyright (C) 2010-2023, the Friendica project
5 * @license GNU AGPL version 3 or any later version
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.
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.
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/>.
22 namespace Friendica\Federation\Factory;
24 use Friendica\Capabilities\ICanCreateFromTableRow;
25 use Friendica\Database\DBA;
26 use Friendica\Federation\Entity;
27 use GuzzleHttp\Psr7\Uri;
29 class GServer extends \Friendica\BaseFactory implements ICanCreateFromTableRow
34 public function createFromTableRow(array $row): Entity\GServer
36 return new Entity\GServer(
38 new Uri($row['nurl']),
42 $row['register_policy'],
43 $row['registered-users'],
44 $row['poco'] ? new Uri($row['poco']) : null,
45 $row['noscrape'] ? new Uri($row['noscrape']) : null,
48 $row['relay-subscribe'],
50 new \DateTimeImmutable($row['created']),
51 $row['last_poco_query'] !== DBA::NULL_DATETIME ? new \DateTimeImmutable($row['last_poco_query']) : null,
52 $row['last_contact'] !== DBA::NULL_DATETIME ? new \DateTimeImmutable($row['last_contact']) : null,
53 $row['last_failure'] !== DBA::NULL_DATETIME ? new \DateTimeImmutable($row['last_failure']) : null,
54 $row['directory-type'],
55 $row['detection-method'],
57 $row['next_contact'] !== DBA::NULL_DATETIME ? new \DateTimeImmutable($row['next_contact']) : null,
59 $row['active-week-users'],
60 $row['active-month-users'],
61 $row['active-halfyear-users'],
63 $row['local-comments'],