public function getCronEntriesToRun($currentTime = null)
{
$currentTime = ($currentTime === null ? XenForo_Application::$time : $currentTime);
return $this->fetchAllKeyed('
SELECT entry.*
FROM xf_cron_entry AS entry
LEFT JOIN xf_addon AS addon ON (entry.addon_id = addon.addon_id)
WHERE entry.active = 1
AND entry.next_run < ?
AND (addon.addon_id IS NULL OR addon.active = 1)
ORDER BY entry.next_run
', 'entry_id', $currentTime);
}