*/ namespace wishthis; class Wishlist { private int $id; private string $hash; public mixed $data; public mixed $products; public bool $exists = false; public function __construct(int|string $id_or_hash) { global $database; $column; if (is_int($id_or_hash)) { $column = 'id'; } if (is_string($id_or_hash)) { $column = 'hash'; $id_or_hash = '"' . $id_or_hash . '"'; } /** * Get Wishlist */ $this->data = $database->query('SELECT * FROM `wishlists` WHERE `' . $column . '` = ' . $id_or_hash . ';') ->fetch(); /** Exists */ if (isset($this->data['id'])) { $this->id = $this->data['id']; $this->exists = true; } else { return; } /** * Get Products */ $this->products = $database->query('SELECT * FROM `products` WHERE `wishlist` = ' . $this->id . ';') ->fetchAll(); } public function getCards(): void { $products = array_filter($this->products, function ($product) { if ('unavailable' !== $product['status']) { return true; } }); if (!empty($products)) { ?>
get($product['url']); ?>
image) { ?>
title) { ?>
favicon) { ?> url) { ?> title ?> title ?>
keywords) { ?>
keywords ?>
description) { ?>
description ?>
publishedTime) { ?> publishedTime ?> providerName) { ?> providerName ?>
Empty

This wishlist seems to be empty.