Files
breadcrumb-the-shire/modules/bookmarks/lib/Module/Bookmarks/Service/BookmarkServicesFactory.php

23 lines
651 B
PHP
Raw Normal View History

<?php
namespace MintyPHP\Module\Bookmarks\Service;
class BookmarkServicesFactory
{
private ?BookmarkService $bookmarkService = null;
public function __construct(
private readonly BookmarkRepositoryFactory $bookmarkRepositoryFactory
) {
}
public function createBookmarkService(): BookmarkService
{
return $this->bookmarkService ??= new BookmarkService(
$this->bookmarkRepositoryFactory->createBookmarkRepository(),
$this->bookmarkRepositoryFactory->createBookmarkGroupRepository(),
$this->bookmarkRepositoryFactory->createBookmarkNavigationRepository()
);
}
}