co = $co; } public function createImgGateway(int $idImg, string $imgPath, bool $isImgProfile) : bool { $query = " INSERT INTO Images VALUES (:id_img, :img_path, :is_img_profile) "; return $this -> co -> executeQuery($query, [ 'id_img' => array($idImg, PDO::PARAM_INT), 'img_path' => array($imgPath, PDO::PARAM_STR), 'is_img_profile' => array($isImgProfile, PDO::PARAM_BOOL), ]); } public function findImgById(int $idImg) : array { $query = " SELECT * FROM Images WHERE id_image = :id_img "; $this -> co -> executeQuery($query, ['id_img' => array($idImg, PDO::PARAM_INT)]); return $this -> co -> getResults(); } public function findAllImg() : array { $query = " SELECT * FROM Images "; $this -> co -> executeQuery($query); return $this -> co -> getResults(); } public function findAllImgProfile() : array { $query = " SELECT * FROM Images WHERE is_img_prfl "; $this -> co -> executeQuery($query); return $this -> co -> getResults(); } public function deleteImgGateway(int $idImg) : bool { $query = " DELETE FROM Images WHERE id_image = :id_img "; return $this -> co -> executeQuery($query, ['id_img' => array($idImg, PDO::PARAM_INT)]); } public function updateImgGateway(int $idImg, string $imgPath) : bool { $query = " UPDATE Images SET img_path = :img_path WHERE id_image = :id_img "; return $this -> co -> executeQuery($query, [ 'id_img' => array($idImg, PDO::PARAM_INT), 'img_path' => array($imgPath, PDO::PARAM_STR) ]); } }