]> git.mxchange.org Git - friendica.git/blob - src/Contact/Introduction/Entity/Introduction.php
Fixings & add tests
[friendica.git] / src / Contact / Introduction / Entity / Introduction.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2010-2021, 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\Contact\Introduction\Entity;
23
24 use Friendica\BaseEntity;
25
26 /**
27  * @property-read int $uid
28  * @property-read int $sid
29  * @property-read int|null $cid
30  * @property-read bool $knowyou
31  * @property-read bool $duplex
32  * @property-read string $note
33  * @property-read string $hash
34  * @property-read \DateTime $datetime
35  * @property-read bool $ignore
36  * @property-read int|null $id
37  */
38 class Introduction extends BaseEntity
39 {
40         /** @var int */
41         protected $uid;
42         /** @var int */
43         protected $sid;
44         /** @var int|null */
45         protected $cid;
46         /** @var bool */
47         protected $knowyou;
48         /** @var bool */
49         protected $duplex;
50         /** @var string */
51         protected $note;
52         /** @var string */
53         protected $hash;
54         /** @var \DateTime */
55         protected $datetime;
56         /** @var bool */
57         protected $ignore;
58         /** @var int|null */
59         protected $id;
60
61         /**
62          * @param int       $uid
63          * @param int       $sid
64          * @param int|null  $cid
65          * @param bool      $knowyou
66          * @param bool      $duplex
67          * @param string    $note
68          * @param string    $hash
69          * @param \DateTime $datetime
70          * @param bool      $ignore
71          * @param int|null  $id
72          */
73         public function __construct(int $uid, int $sid, ?int $cid, bool $knowyou, bool $duplex, string $note, string $hash, \DateTime $datetime, bool $ignore, ?int $id)
74         {
75                 $this->uid      = $uid;
76                 $this->sid      = $sid;
77                 $this->cid      = $cid;
78                 $this->knowyou  = $knowyou;
79                 $this->duplex   = $duplex;
80                 $this->note     = $note;
81                 $this->hash     = $hash;
82                 $this->datetime = $datetime;
83                 $this->ignore   = $ignore;
84                 $this->id       = $id;
85         }
86
87         /**
88          * Ignore the current Introduction
89          */
90         public function ignore()
91         {
92                 $this->ignore = true;
93         }
94 }