/**
* Method to add an entry to the log.
*
* @param LogEntry $entry The log entry object to add to the log.
*
* @return void
*
* @since 1.7.0
* @throws \RuntimeException
*/
public function addEntry(LogEntry $entry)
{
// Connect to the database if not connected.
if (empty($this->db)) {
$this->connect();
}
// Convert the date.
$entry->date = $entry->date->toSql(false, $this->db);
$this->db->insertObject($this->table, $entry);
}