<?php

namespace Entity\Model;

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

class Langues extends QueryBuilder
{
    protected string $table = 'LANGUES with (nolock)';
    protected string $primaryKey = 'COD_LNG';
    protected string $libelle = 'LIBELLE';
    public string $titre;

    public function getArchitecture(\Helpers\Trad\ITrad $trad)
    {
        return
        [
            'COD_LNG' => [
                'nomChamp' => $trad->t('Code Langages'),
                'type' => 'TEXTE',
                'taille' => 3,
                'obligatoire' => true
            ],
            'LIBELLE' =>
            [
                'nomChamp' => $trad->t('Libelle'),
                'type' => 'TEXTE',
                'taille' => 20,
                'obligatoire' => true

            ],
            'IMG_LNG' =>
            [
                'nomChamp' => $trad->t('Image langue'),
                'type' => 'TEXTE',
                'taille' => 20,
                'obligatoire' => true

            ],
            'TYPDTEPROC' =>
            [
                'nomChamp' => $trad->t('Type Date proc'),
                'type' => 'TEXTE',
                'taille' => 1,
                'obligatoire' => true

            ],
            'COD_INTUI' =>
            [
                'nomChamp' => $trad->t('Code Intuition'),
                'type' => 'TEXTE',
                'taille' => 3,
                'obligatoire' => true

            ]
        ];
    }

    /**
     * @return array<string|int,string>
     */
    public function listChoice()
    {
        return array_column($this->fetchAll(), 'LIBELLE', 'COD_LNG');
    }
}
