Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
FollowQueue
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
7
100.00% covered (success)
100.00%
1 / 1
 setFollower
n/a
0 / 0
1
n/a
0 / 0
 getFollower
n/a
0 / 0
1
n/a
0 / 0
 setFollowed
n/a
0 / 0
1
n/a
0 / 0
 getFollowed
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
 schemaDef
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
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
20namespace App\Entity;
21
22use App\Core\Entity;
23use DateTimeInterface;
24
25/**
26 * Entity for Subscription queue
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 */
39class FollowQueue extends Entity
40{
41    // {{{ Autocode
42    // @codeCoverageIgnoreStart
43    private int $follower;
44    private int $followed;
45    private \DateTimeInterface $created;
46
47    public function setFollower(int $follower): self
48    {
49        $this->follower = $follower;
50        return $this;
51    }
52
53    public function getFollower(): int
54    {
55        return $this->follower;
56    }
57
58    public function setFollowed(int $followed): self
59    {
60        $this->followed = $followed;
61        return $this;
62    }
63
64    public function getFollowed(): int
65    {
66        return $this->followed;
67    }
68
69    public function setCreated(DateTimeInterface $created): self
70    {
71        $this->created = $created;
72        return $this;
73    }
74
75    public function getCreated(): DateTimeInterface
76    {
77        return $this->created;
78    }
79
80    // @codeCoverageIgnoreEnd
81    // }}} Autocode
82
83    public static function schemaDef(): array
84    {
85        return [
86            'name'        => 'follow_queue',
87            'description' => 'Holder for Follow requests awaiting moderation.',
88            'fields'      => [
89                'follower' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'Follow_queue_follower_fkey', 'not null' => true, 'description' => 'gsactor making the request'],
90                'followed' => ['type' => 'int', 'foreign key' => true, 'target' => 'GSActor.id', 'multiplicity' => 'many to one', 'name' => 'Follow_queue_followed_fkey', 'not null' => true, 'description' => 'gsactor being followed'],
91                'created'  => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'],
92            ],
93            'primary key' => ['follower', 'followed'],
94            'indexes'     => [
95                'follow_queue_follower_created_idx' => ['follower', 'created'],
96                'follow_queue_followed_created_idx' => ['followed', 'created'],
97            ],
98        ];
99    }
100}