<?php

namespace App\Patient\Repository;

use App\Patient\Entity\SessionPayment;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

class SessionPaymentRepository extends ServiceEntityRepository
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, SessionPayment::class);
    }

    public function save(SessionPayment $payment): void
    {
        $this->getEntityManager()->persist($payment);
        $this->getEntityManager()->flush();
    }

    public function remove(SessionPayment $payment): void
    {
        $this->getEntityManager()->remove($payment);
        $this->getEntityManager()->flush();
    }

    public function findByUuid(string $uuid): ?SessionPayment
    {
        return $this->findOneBy(['uuid' => $uuid]);
    }
}
