<?php

namespace Modules\Evaluation\Service;

use Entity\Model\ParamDico;
use Helpers\Outil\Sql;
use PDO;

class ResultatService
{
    private PDO $pdo;

    public function __construct(PDO $pdo)
    {
        $this->pdo = $pdo;
    }

    /**
     * getEvalParamdico
     *
     * @return array<mixed>
     */
    public function getEvalParamdico()
    {
        $paramDico = (new ParamDico($this->pdo))
        ->find(['TYPEDICO' => 'EVAL_FOURN', 'ID1' => 'NOTATION'], [
            'ALPHA3',
            'ALPHA4',
            'ALPHA5',
            'ALPHA6',
            'ALPHA7',
            'ALPHA8',
            'ALPHA9',
            'ALPHA10',
        ], [], PDO::FETCH_ASSOC);

        if ($paramDico) {
            return $paramDico;
        } else {
            return [
                'ALPHA3' => '4',
                'ALPHA4' => '7',
                'ALPHA5' => '10',
                'ALPHA6' => '',
                'ALPHA7' => '',
                'ALPHA8' => '',
                'ALPHA9' => Sql::setBoolSqlText(false),
                'ALPHA10' => Sql::setBoolSqlText(false),
            ];
        }
    }
}
