<?php

namespace Models;

use Bases\Model;

class Infolettre extends Model {

    protected $table = "infolettres";

    /**
     * Insère une inscription a l'infolettre
     *
     * @param string $nomComplet
     * @param string $courriel
     * 
     * @return void
     */
    public function inserer(string $nomComplet, string $courriel,)
    {
        $sql = "INSERT INTO $this->table (nom, courriel)
                VALUES (:nomComplet, :courriel)";

        $requete = $this->pdo()->prepare($sql);

        return $requete->execute([
            ":nomComplet" => $nomComplet,
            ":courriel" => $courriel
        ]);
    }
}