<?php

namespace Entity\Model;

use Helpers\QueryBuilder\QueryBuilder;
use Helpers\Trad\ITrad;

class Docatt extends QueryBuilder
{
    protected \PDO $pdo;
    
    protected string $table = 'DOC_ATT with (nolock)';
    
    protected string $primaryKey = '';
    
    public function __construct(\PDO $pdo)
    {
        $this->pdo = $pdo;
    }

    public function getArchitecture(ITrad $trad)
    {
        return [
            'NO_ORDRE'              => ['nomChamp'  => $trad->t('Numéro d\'ordre')],
            'TYPE_PJ'               => ['nomChamp'  => $trad->t('Type de PJ')],
            'TITRE'                 => ['nomChamp'  => $trad->t('Titre du document')],
            'COPIE'                 => ['nomChamp'  => $trad->t('Copie ?'), 'type' => 'RADIO'],
            'DT_PARUT'              => ['nomChamp'  => $trad->t('Date de parution'), 'type' => 'DATE'],
            'DT_VALID'              => ['nomChamp'  => $trad->t('Date de validité'), 'type' => 'DATE'],
            'COD_ENR'               => ['nomChamp'  => $trad->t('Code enregistrement')],
            'AUTEUR'                => ['nomChamp'  => $trad->t('Auteur')],
            'CENTRE'                => ['nomChamp'  => $trad->t('Centre')],
            'NOM_ORI'               => ['nomChamp'  => $trad->t('Nom original du fichier')],
            'TYPE_FT'               => ['nomChamp'  => $trad->t('Type de document rattaché')],
            'CODE_FOU'              => ['nomChamp'  => $trad->t('Code fournisseur')],
            'NPRELANCE'             => ['nomChamp'  => $trad->t('Ne pas relancer ?'), 'type' => 'RADIO'],
            'PJ_CDE'                => ['nomChamp'  => $trad->t('Ajoutée PJ des commandes ?'), 'type' => 'RADIO'],
            'GERE_PAR_PARTENAIRE'   => ['nomChamp'  => $trad->t('Géré par un partenaire ?'), 'type' => 'RADIO'],
            'DOC_INUTILE'           => ['nomChamp'  => $trad->t('Document inutile ?'), 'type' => 'RADIO'],
            'CODE_CAT'              => ['nomChamp'  => $trad->t('Code de la catégorie')],
            'DTE_DERNREL'           => ['nomChamp'  => $trad->t('Date de dernière relance'), 'type' => 'DATE'],
            'CONTRATCDE'            => ['nomChamp'  => $trad->t('Contrat de commande'), 'type' => 'RADIO'],
        ];
    }
}
