<?php

declare(strict_types=1);

namespace Gls\GlsPoland\Repository;

use Gls\GlsPoland\Entity\OrderParcelShop;

/**
 * @extends EntityRepository<OrderParcelShop>
 *
 * @method OrderParcelShop|null find($id, $lockMode = null, $lockVersion = null)
 * @method OrderParcelShop|null findOneBy(array $criteria, array $orderBy = null)
 * @method OrderParcelShop[] findAll()
 * @method OrderParcelShop[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 */
class OrderParcelShopRepository extends EntityRepository
{
    public function add(OrderParcelShop $entity, bool $flush = true): void
    {
        $entityManager = $this->getEntityManager();
        $entityManager->persist($entity);

        if ($flush) {
            $entityManager->flush();
        }
    }

    protected static function getEntityClass(): string
    {
        return OrderParcelShop::class;
    }
}
