projet_php/models/ImageModel.php
2026-03-02 09:13:53 +01:00

39 lines
No EOL
639 B
PHP

<?php
namespace Models;
use \PDO;
/**
* Traitement de la requête pour les images
* @author Laura
*/
class ImageModel extends MotherModel{
/**
* Fonction de récupération des images
* @param int $intLimit
* @return array
*/
public function findAllImage(int $intLimit=0):array{
$strRq = "SELECT image.*
FROM image";
if ($intLimit > 0){
$strRq .= " LIMIT :limit";
}
$rqPrep = $this->_db->prepare($strRq);
if ($intLimit > 0){
$rqPrep->bindValue(":limit", $intLimit, PDO::PARAM_INT);
}
$rqPrep->execute();
return $rqPrep->fetchAll();
}
}