Files
breadcrumb-the-shire/modules/notifications/lib/Module/Notifications/Service/NotificationServicesFactory.php

24 lines
685 B
PHP

<?php
namespace MintyPHP\Module\Notifications\Service;
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
class NotificationServicesFactory
{
private ?NotificationService $notificationService = null;
public function __construct(
private readonly NotificationRepositoryFactory $notificationRepositoryFactory
) {
}
public function createNotificationService(UserTenantRepositoryInterface $userTenantRepository): NotificationService
{
return $this->notificationService ??= new NotificationService(
$this->notificationRepositoryFactory->createNotificationRepository(),
$userTenantRepository
);
}
}