public static function getNextRun() { $now = time(); $st = DB::sql("SELECT * FROM cron WHERE nextrun<{$now} AND enable=1 ORDER BY `order` LIMIT 0,1"); $st->execute(); return $st->fetchObject(__CLASS__); }
private function getNextRun() { $next = Cron::getNextRun(); if (!$next) { return false; } $this->cronId = $next->id; $cl = ucfirst($this->cronId); $cl = "\\Helper\\Cron\\{$cl}"; $obj = new $cl(); return $obj; }