<?php

namespace Entity\Model;

use Helpers\QueryBuilder\QueryBuilder;

/**
 * Filtres des Requete (ReqEnt) d'EtatStat
 */
class ReqFiltresDon extends QueryBuilder
{
    protected string $table = 'REQ_FILTRES_DON with (nolock)';
    protected array $primKey = [
        'REQ_ETAT',
        'REQ_ID',
        'CODE_FILTRE',
        'TYPE_FILTRE',
    ];

    /**
     * @param array<mixed> $entity ReqFiltresDon (Actually ReqFiltres now)
     */
    public static function getPlaceholderId(array $entity) :string
    {
        return
            'reqfilter_'
            // . $entity['REQ_ID']
            . '_' . $entity['TYPE_FILTRE']
            . '_' . $entity['CODE_FILTRE'];
    }

    /**
     * @param array<mixed> $entity ReqFiltresDon|ReqFiltres
     */
    public static function getInputId(array $entity) :string
    {
        return
            'reqfilter_'
            . $entity['TYPE_FILTRE']
            . '_' . $entity['CODE_FILTRE'];
    }
}
