DJJob.php
public static function bulkEnqueue($handlers, $queue = "default", $run_at = null) {
        $sql = "INSERT INTO " . self::$jobsTable . " (handler, queue, run_at, created_at) VALUES";
        $sql .= implode(",", array_fill(0, count($handlers), "(?, ?, ?, NOW())"));

        $parameters = array();
        foreach ($handlers as $handler) {
            $parameters []= serialize($handler);
            $parameters []= (string) $queue;
            $parameters []= $run_at;
        }
        $affected = self::runUpdate($sql, $parameters);

        if ($affected < 1) {
            self::log("[JOB] failed to enqueue new jobs", self::ERROR);
            return false;
        }

        if ($affected != count($handlers))
            self::log("[JOB] failed to enqueue some new jobs", self::ERROR);

        return true;
    }
public static function bulkEnqueue($handlers, $queue = "default", $run_at = null) {
        $sql = "INSERT INTO " . self::$jobsTable . " (handler, queue, run_at, created_at) VALUES";
        $sql .= implode(",", array_fill(0, count($handlers), "(?, ?, ?, NOW())"));

        $parameters = array();
        foreach ($handlers as $handler) {
            $parameters []= serialize($handler);
            $parameters []= (string) $queue;
            $parameters []= $run_at;
        }
        $affected = self::runUpdate($sql, $parameters);

        if ($affected < 1) {
            self::log("[JOB] failed to enqueue new jobs", self::ERROR);
            return false;
        }

        if ($affected != count($handlers))
            self::log("[JOB] failed to enqueue some new jobs", self::ERROR);

        return true;
    }
public static function bulkEnqueue ( $ handlers , $ queue = "default" , $ run_at = null ) { $ sql = "INSERT INTO " . self :: $ jobsTable . " (handler, queue, run_at, created_at) VALUES" ; $ sql .= implode ( "," , array_fill ( 0 , count ( $ handlers ) , "(?, ?, ?, NOW())" ) ) ; $ parameters = array ( ) ; foreach ( $ handlers as $ handler ) { $ parameters [ ] = serialize ( $ handler ) ; $ parameters [ ] = ( string ) $ queue ; $ parameters [ ] = $ run_at ; } $ affected = self :: runUpdate ( $ sql , $ parameters ) ; if ( $ affected < 1 ) { self :: log ( "[JOB] failed to enqueue new jobs" , self :: ERROR ) ; return false ; } if ( $ affected != count ( $ handlers ) ) self :: log ( "[JOB] failed to enqueue some new jobs" , self :: ERROR ) ; return true ; }
Bulk enqueues a lot of jobs to the database.

@param object[] $handlers An array of handlers to enqueue.
@param string $queue The queue to enqueue the handlers to.
@param string $run_at A valid mysql DATETIME string at which to run the jobs.

@return bool
Bulk enqueues a lot of jobs to the database .