smarty ça casse les couilles zebi

This commit is contained in:
Yasder5 2026-02-04 22:51:01 +01:00
parent b1960b2f35
commit aec3c845e0
469 changed files with 53465 additions and 69 deletions

View file

@ -1,47 +0,0 @@
<?php
require_once('../config/database.php');
/**
* Traitement des requêtes pour les catégories
* @author : Laura
*/
class CategoryModel extends Connect{
/**
* Fonction de récupération des catégories
* @return array
*/
public function findAllCategory(int $intLimit=0):array{
$strRq = "SELECT category.*
FROM category";
if ($intLimit > 0){
$strRq .= " LIMIT ".$intLimit;
}
return $this->_db->query($strRq)->fetchAll();
}
/**
* fonction d'insertion d'une nouvelle catégorie dans la bdd
* @param object $objUser L'objet utilisateur
* @return bool Est-ce que la requête s'est bien passée (true/false)
*/
public function insert(object $objCategory):bool{
$strRq = "INSERT INTO category (category_name, category_parent)
VALUES (:name, :parent)";
$rqPrep = $this->_db->prepare($strRq);
$rqPrep->bindValue(":name", $objCategory->getName(), PDO::PARAM_STR);
$rqPrep->bindValue(":parent", $objCategory->getParent(), PDO::PARAM_STR);
return $rqPrep->execute();
}
}