Copie propre du code final de Folliow (projet d'équipe DWWM)
This commit is contained in:
commit
eed64cfeb6
67 changed files with 17897 additions and 0 deletions
39
models/ImageModel.php
Normal file
39
models/ImageModel.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue