/** * Updates the event with corresponding data * Returns TRUE on success, FALSE otherwise * * @global wpdb $wpdb * @param Event $event * @return boolean */ public static function updateEvent($event) { global $wpdb; $query = "UPDATE `datr_Events` SET "; foreach ($event->getEventParams() as $key => $value) { if (EventDatabaseManager::isEventFieldInteger($key)) { $value = $value == "" ? '0' : $value; $query .= "{$key} = {$value}, "; } else { $query .= "{$key} = '{$value}', "; } } $query = substr($query, 0, strlen($query) - 2) . " WHERE eventID = " . $event->getEventID(); return $wpdb->query($query); }