private function addMessage($toWhomID, $unixWhen, $text, $type) { $this->deleteOldMessages($toWhomID); $db = new ReservationDBInterface(); $table = "res_message"; $values = array('res_message_user_id' => $toWhomID, 'res_message_time' => date("Y-m-d H:i:s", $unixWhen), 'res_message_text' => $text, 'res_message_type' => $type); return $db->insert($table, $values); }
private function addToLog($who, $unixWhen, $text, $type) { $db = new ReservationDBInterface(); $table = "res_log"; $values = array('res_log_who' => $who, 'res_log_when' => date("Y-m-d H:i:s", $unixWhen), 'res_log_text' => $text); $logEntry = new ManualLogEntry('reservation', $type); // Log action 'booking' in the Special:Log for 'reservation' $logEntry->setPerformer($this->getUser()); // User object, the user who performed this action $logEntry->setTarget($this->getTitle()); // The page that this log entry affects, a Title object $logEntry->setComment($text); // Optional, user provided comment $logid = $logEntry->insert(); $logEntry->publish($logid); return $db->insert($table, $values); }