]> git.mxchange.org Git - friendica.git/blob - src/Factory/Mastodon/Relationship.php
@brief is removed completely
[friendica.git] / src / Factory / Mastodon / Relationship.php
1 <?php
2
3 namespace Friendica\Factory\Mastodon;
4
5 use Friendica\Api\Entity\Mastodon\Relationship as RelationshipEntity;
6 use Friendica\BaseFactory;
7 use Friendica\Model\Contact;
8
9 class Relationship extends BaseFactory
10 {
11         /**
12          * @param int $userContactId Contact row id with uid != 0
13          * @return RelationshipEntity
14          * @throws \Exception
15          */
16         public function createFromContactId(int $userContactId)
17         {
18                 return $this->createFromContact(Contact::getById($userContactId));
19         }
20
21         /**
22          * @param array $userContact Full contact row record with uid != 0
23          * @return RelationshipEntity
24          */
25         public function createFromContact(array $userContact)
26         {
27                 return new RelationshipEntity($userContact['id'], $userContact);
28         }
29
30         /**
31          * @param int $userContactId Contact row id with uid != 0
32          * @return RelationshipEntity
33          */
34         public function createDefaultFromContactId(int $userContactId)
35         {
36                 return new RelationshipEntity($userContactId);
37         }
38 }