<?php

namespace Entity\Model;

use Helpers\Outil\Sql;
use Helpers\QueryBuilder\QueryBuilder;

class FourPartenaireData extends QueryBuilder
{
    protected string $table = 'FOUR_PARTENAIRE_DATA with (nolock)';
    protected string $primaryKey = '';
    protected array $primKey = ['CODE_FOU','CODEPARTENAIRE'];

    

    public function deleteEntity(string $fournissId, string $partenaire) :bool
    {
        return $this->delete([
            'CODE_FOU' => $fournissId,
            'CODEPARTENAIRE' => $partenaire,
        ]);
    }

    public function insertEntity(
        string $fournissId,
        string $partenaire,
        bool $doc,
        bool $activite
    ) :void {
        $this->merge([
            'CODE_FOU' => $fournissId,
            'CODEPARTENAIRE' => $partenaire,
            'DOC_LEGAUX' => $doc,
            'ACTIVITE' => $activite,
            'DATE_DEBUT_TRAITE' => date('Ymd'),
        ]);
    }
}
