return;
}
- $notification = (new Notifications\Factory\Notification(DI::baseUrl(), DI::l10n(), DI::localRelationship(), DI::logger()))->createForUser(
+ $notification = DI::notificationFactory()->createForUser(
$uid,
$item['vid'],
$type,
*/
public static function insertNotification(int $actor, string $verb, int $uid): bool
{
- $notification = (new Notifications\Factory\Notification(DI::baseUrl(), DI::l10n(), DI::localRelationship(), DI::logger()))->createForRelationship(
+ $notification = DI::notificationFactory()->createForRelationship(
$uid,
$actor,
$verb
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Cache\Capability\ICanCache;
use Friendica\Core\L10n;
-use Friendica\Core\System;
-use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Post;
use Friendica\Model\Verb;
/** @var ICanCache */
private $cache;
- public function __construct(\Friendica\App\BaseURL $baseUrl, \Friendica\Core\L10n $l10n, \Friendica\Contact\LocalRelationship\Repository\LocalRelationship $localRelationshipRepo, LoggerInterface $logger)
+ public function __construct(\Friendica\App\BaseURL $baseUrl, \Friendica\Core\L10n $l10n, \Friendica\Contact\LocalRelationship\Repository\LocalRelationship $localRelationshipRepo, LoggerInterface $logger, ICanCache $cache)
{
parent::__construct($logger);
$this->baseUrl = $baseUrl;
$this->l10n = $l10n;
$this->localRelationshipRepo = $localRelationshipRepo;
- $this->cache = DI::cache(); // @todo Add the correct mechanism for class construction here
+ $this->cache = $cache;
}
public function createFromTableRow(array $row): Entity\Notification