<?php

namespace Modules\ProjetAchat\Service;

use Entity\Model\Doa;
use Modules\ProjetAchat\Repository\Modele;

class ModeleService
{
    private $pdo;

    /**
     * @var Doa $doa
     */
    private $doa;

    /**
     * @var Modele $modeleRepository
     */
    private $modeleRepository;

    /**
     * ModeleService constructor.
     */
    public function __construct($pdo)
    {
        $this->pdo = $pdo;
        $this->doa = new Doa($pdo);
        $this->modeleRepository = new Modele($this->pdo);
    }

    /**
     * @return array<mixed>
    */
    public function findModel(int $id) : ?array
    {
        return $this->modeleRepository->find($id);
    }
    
    /**
     * @return Doa
     */
    public function getDoa()
    {
        return $this->doa;
    }
}
