<?php

namespace Modules\Facture\Repository;

class SectImputation
{
    private $pdo;

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

    public function getCGAction($code_SI, $ste_si)
    {
        $req            = " SELECT	CODE_STE,
                                    UPPER(CODE_SI) CODE_SI,
                                    UPPER(LIBELLE) LIBELLE, 
                                    SICODG,
                                    IMPCODG
                            FROM SECTIMPU with(nolock)
                            WHERE UPPER(CODE_SI) =:value
                            AND CODE_STE =:value1
                        ";

        $arrayReq       = [
            ':value'    => $code_SI,
            ':value1'   => $ste_si
        ];

        
        $sectImpu       = $this->pdo->prepare($req);
        
        $sectImpu->execute($arrayReq);
        return $sectImpu->fetch($this->pdo::FETCH_ASSOC);
    }
}
