3 namespace Friendica\Navigation\Notifications\Factory;
5 use Friendica\BaseFactory;
6 use Friendica\Capabilities\ICanCreateFromTableRow;
7 use Friendica\Content\Text\BBCode;
8 use GuzzleHttp\Psr7\Uri;
10 class Notify extends BaseFactory implements ICanCreateFromTableRow
12 public function createFromTableRow(array $row): \Friendica\Navigation\Notifications\Entity\Notify
14 return new \Friendica\Navigation\Notifications\Entity\Notify(
18 new Uri($row['photo']),
19 new \DateTime($row['date'], new \DateTimeZone('UTC')),
21 new Uri($row['link']),
31 $row['parent-uri-id'],
36 public function createFromParams($params, $itemlink = null, $item_id = null, $uri_id = null, $parent_id = null, $parent_uri_id = null): \Friendica\Navigation\Notifications\Entity\Notify
38 return new \Friendica\Navigation\Notifications\Entity\Notify(
39 $params['type'] ?? '',
40 $params['source_name'] ?? '',
41 new Uri($params['source_link'] ?? ''),
42 new Uri($params['source_photo'] ?? ''),
45 new Uri($itemlink ?? ''),
47 $params['verb'] ?? '',
48 $params['otype'] ?? '',
49 substr(strip_tags(BBCode::convertForUriId($uri_id, $params['source_name'])), 0, 255),