public function checkUpdates() { $ids = array(); $product_ids = xtc_db_query("\tSELECT DISTINCT `products_id`\n\t\t\t\t\t\t\t\t\t\tFROM `idealo_realtime_update`"); while ($product = xtc_db_fetch_array($product_ids)) { $ids[] = $product['products_id']; } if (empty($ids)) { if (!$this->send_failed_request) { if ($this->timeGone) { $communication = new Communication($this->login); $communication->setTimeStamp(); } } } else { foreach ($ids as $id) { $product_ids = xtc_db_query("\tSELECT `id`, `event`\n\t\t\t\t\t\t\t\t\t\t\t\tFROM `idealo_realtime_update`\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE `products_id` = " . $id . " ORDER BY `id` ASC"); $update = array(); while ($product = xtc_db_fetch_array($product_ids)) { $update[] = $product['event']; } $count = count($update); $count--; $this->update[] = array('product' => $id, 'event' => $update[$count]); } } }