<?php

declare(strict_types=1);

namespace App\Module\Integration\Infrastructure\Doctrine;

use App\Module\Integration\Domain\Entity\BookStackConfiguration;
use App\Module\Integration\Domain\Repository\BookStackConfigurationRepositoryInterface;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/**
 * @extends ServiceEntityRepository<BookStackConfiguration>
 */
class DoctrineBookStackConfigurationRepository extends ServiceEntityRepository implements BookStackConfigurationRepositoryInterface
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, BookStackConfiguration::class);
    }

    public function findSingleton(): ?BookStackConfiguration
    {
        return $this->findOneBy([]);
    }
}
