<?php

/*
 * This file is part of the Serenity package.
 *
 * (c) CP Creation <web@cpcreation.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Serenity\CoreBundle\Seed\Doctrine\Repository;

use Doctrine\Persistence\ManagerRegistry;
use Serenity\CoreBundle\Seed\Entity\SeedRun;
use Serenity\CoreBundle\Shared\Doctrine\Repository\BaseRepository;
use Symfony\Component\Uid\Uuid;

/**
 * @extends BaseRepository<SeedRun>
 */
final class SeedRunRepository extends BaseRepository
{
    private const string ENTITY_CLASS = SeedRun::class;

    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, self::ENTITY_CLASS);
    }

    public function findOneByRunId(Uuid $runId): ?SeedRun
    {
        return $this->findOneBy([
            'runId' => $runId,
        ]);
    }
}
