public function getAllProducts($userid, $cartId, $categoryId)
 {
     $data = $this->db->getAvailableProductsInCategory($userid, $cartId, $categoryId);
     $categoryProducts = [];
     foreach ($data as $prod) {
         $product = new Product($prod);
         if ($product->getIsSold() == 0) {
             array_push($categoryProducts, $product);
         }
     }
     return $categoryProducts;
 }
 public function getAll()
 {
     $data = $this->db->getAllEntities(self::PRODUCTS_TABLENAME, 'name');
     $data = array_filter($data, function ($d) {
         return $d['is_sold'] == 0;
     });
     $products = [];
     foreach ($data as $p) {
         $product = new Product($p);
         $product->setName($p['name']);
         array_push($products, $product);
     }
     return $products;
 }