_findAll($sql, 'CategoryEntity'); } public function getCategoryById($id) { $sql = "SELECT id, category from category where id = :category_id"; $stmt = $this->db->prepare($sql); $stmt->execute(["category_id" => $id]); return new CategoryEntity($stmt->fetch()); } }