Update the Introductions domain to use repository, model and collection

This commit is contained in:
Hypolite Petovan 2020-01-05 17:50:33 -05:00
parent 5a1abb8c7d
commit 6b8db5ad13
8 changed files with 124 additions and 86 deletions

View file

@ -23,17 +23,17 @@ class FollowRequest extends BaseFactory
}
/**
* @param Introduction $Introduction
* @param Introduction $introduction
* @return \Friendica\Api\Entity\Mastodon\FollowRequest
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public function createFromIntroduction(Introduction $Introduction)
public function createFromIntroduction(Introduction $introduction)
{
$cdata = Contact::getPublicAndUserContacID($Introduction->{'contact-id'}, $Introduction->uid);
$cdata = Contact::getPublicAndUserContacID($introduction->{'contact-id'}, $introduction->uid);
if (empty($cdata)) {
$this->logger->warning('Wrong introduction data', ['Introduction' => $Introduction]);
$this->logger->warning('Wrong introduction data', ['Introduction' => $introduction]);
throw new HTTPException\InternalServerErrorException('Wrong introduction data');
}
@ -42,6 +42,6 @@ class FollowRequest extends BaseFactory
$apcontact = APContact::getByURL($publicContact['url'], false);
return new \Friendica\Api\Entity\Mastodon\FollowRequest($this->baseUrl, $Introduction->id, $publicContact, $apcontact, $userContact);
return new \Friendica\Api\Entity\Mastodon\FollowRequest($this->baseUrl, $introduction->id, $publicContact, $apcontact, $userContact);
}
}