<?php

namespace MintyPHP\Module\Bookmarks\Service;

use MintyPHP\Module\Bookmarks\Repository\BookmarkGroupRepository;
use MintyPHP\Module\Bookmarks\Repository\BookmarkGroupRepositoryInterface;
use MintyPHP\Module\Bookmarks\Repository\BookmarkNavigationRepository;
use MintyPHP\Module\Bookmarks\Repository\BookmarkNavigationRepositoryInterface;
use MintyPHP\Module\Bookmarks\Repository\BookmarkRepository;
use MintyPHP\Module\Bookmarks\Repository\BookmarkRepositoryInterface;

class BookmarkRepositoryFactory
{
    private ?BookmarkRepository $bookmarkRepository = null;
    private ?BookmarkGroupRepository $groupRepository = null;
    private ?BookmarkNavigationRepository $navigationRepository = null;

    public function createBookmarkRepository(): BookmarkRepositoryInterface
    {
        return $this->bookmarkRepository ??= new BookmarkRepository();
    }

    public function createBookmarkGroupRepository(): BookmarkGroupRepositoryInterface
    {
        return $this->groupRepository ??= new BookmarkGroupRepository();
    }

    public function createBookmarkNavigationRepository(): BookmarkNavigationRepositoryInterface
    {
        return $this->navigationRepository ??= new BookmarkNavigationRepository();
    }
}
