<?php

namespace Models;

use Bases\Model;

class Commentaire extends Model
{
    protected $table = "commentaires";

    public function commentaireAleatoire()
    {
        $sql = "SELECT $this->table.*
                FROM $this->table 
                ORDER BY RAND()
                LIMIT 3";

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

        $requete->execute();

        return $requete->fetchAll();
    }
}