23 lines
651 B
PHP
23 lines
651 B
PHP
|
|
<?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()
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|