<?php

namespace Entity\Model;

use Helpers\QueryBuilder\QueryBuilder;

class CampEve extends QueryBuilder
{
    protected string $table = 'CAMP_EVE with (nolock)';
    protected string $primaryKey = '';

    public function getMaxNumEve(string|int $idCamp): int
    {
        $query = "SELECT MAX(NUM_ORDR) as MAX from CAMP_EVE where ID_CAMP = :idCamp";
        $arrayReq = [
            "idCamp" => $idCamp
        ];

        $stmt = $this->pdo->prepare($query);
        $stmt->execute($arrayReq);

        return intval($stmt->fetch(\PDO::FETCH_ASSOC)['MAX']);
    }
}
