function addToRefreshTable($id, $fromNode = 0) { global $db; $existing = $db->getCol("SELECT node_id FROM sotf_object_status WHERE id='{$id}'"); $neighbours = sotf_Neighbour::listIds(); foreach ($neighbours as $nei) { if ($this->internalData['node_id'] != $nei && $nei != $fromNode && !in_array($nei, $existing)) { $db->query("INSERT INTO sotf_object_status (id, node_id) VALUES('{$id}', {$nei})"); } } debug("added to refresh table"); }