]> git.mxchange.org Git - friendica.git/blob - src/Contact/Introduction/Entity/Introduction.php
Merge pull request #12589 from MrPetovan/bug/warnings
[friendica.git] / src / Contact / Introduction / Entity / Introduction.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\Contact\Introduction\Entity;
23
24 use Friendica\BaseEntity;
25
26 /**
27  * @property-read int $uid
28  * @property-read int $cid Either a public contact id (DFRN suggestion) or user-specific id (Contact::addRelationship)
29  * @property-read int|null $sid
30  * @property-read bool $knowyou
31  * @property-read string $note
32  * @property-read string $hash
33  * @property-read \DateTime $datetime
34  * @property-read bool $ignore
35  * @property-read int|null $id
36  */
37 class Introduction extends BaseEntity
38 {
39         /** @var int */
40         protected $uid;
41         /** @var int */
42         protected $cid;
43         /** @var int|null */
44         protected $sid;
45         /** @var bool */
46         protected $knowyou;
47         /** @var string */
48         protected $note;
49         /** @var string */
50         protected $hash;
51         /** @var \DateTime */
52         protected $datetime;
53         /** @var bool */
54         protected $ignore;
55         /** @var int|null */
56         protected $id;
57
58         /**
59          * @param int       $uid
60          * @param int       $cid
61          * @param int|null  $sid
62          * @param bool      $knowyou
63          * @param string    $note
64          * @param string    $hash
65          * @param \DateTime $datetime
66          * @param bool      $ignore
67          * @param int|null  $id
68          */
69         public function __construct(int $uid, int $cid, ?int $sid, bool $knowyou, string $note, string $hash, \DateTime $datetime, bool $ignore, ?int $id)
70         {
71                 $this->uid      = $uid;
72                 $this->cid      = $cid;
73                 $this->sid      = $sid;
74                 $this->knowyou  = $knowyou;
75                 $this->note     = $note;
76                 $this->hash     = $hash;
77                 $this->datetime = $datetime;
78                 $this->ignore   = $ignore;
79                 $this->id       = $id;
80         }
81
82         /**
83          * Ignore the current Introduction
84          */
85         public function ignore()
86         {
87                 $this->ignore = true;
88         }
89 }