Model\Cron::getNextRun PHP Method

getNextRun() public static method

public static getNextRun ( )
    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__);
    }

Usage Example

Exemplo n.º 1
0
 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;
 }