2026-03-19 22:09:44 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MintyPHP\Module\Notifications\Service;
|
|
|
|
|
|
2026-03-20 00:05:03 +01:00
|
|
|
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
|
|
|
|
|
|
2026-03-19 22:09:44 +01:00
|
|
|
class NotificationServicesFactory
|
|
|
|
|
{
|
|
|
|
|
private ?NotificationService $notificationService = null;
|
|
|
|
|
|
|
|
|
|
public function __construct(
|
|
|
|
|
private readonly NotificationRepositoryFactory $notificationRepositoryFactory
|
|
|
|
|
) {
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-20 00:05:03 +01:00
|
|
|
public function createNotificationService(UserTenantRepositoryInterface $userTenantRepository): NotificationService
|
2026-03-19 22:09:44 +01:00
|
|
|
{
|
|
|
|
|
return $this->notificationService ??= new NotificationService(
|
2026-03-20 00:05:03 +01:00
|
|
|
$this->notificationRepositoryFactory->createNotificationRepository(),
|
|
|
|
|
$userTenantRepository
|
2026-03-19 22:09:44 +01:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|