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

21 lines
536 B
PHP
Raw Normal View History

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