3 namespace Friendica\Factory\Api\Mastodon;
5 use Friendica\Object\Api\Mastodon\Relationship as RelationshipEntity;
6 use Friendica\BaseFactory;
7 use Friendica\Model\Contact;
9 class Relationship extends BaseFactory
12 * @param int $userContactId Contact row id with uid != 0
13 * @return RelationshipEntity
16 public function createFromContactId(int $userContactId)
18 return $this->createFromContact(Contact::getById($userContactId));
22 * @param array $userContact Full contact row record with uid != 0
23 * @return RelationshipEntity
25 public function createFromContact(array $userContact)
27 return new RelationshipEntity($userContact['id'], $userContact);
31 * @param int $userContactId Contact row id with uid != 0
32 * @return RelationshipEntity
34 public function createDefaultFromContactId(int $userContactId)
36 return new RelationshipEntity($userContactId);