src/Model/Table/QueuedJobsTable.php
public function createJob($jobType, array $data = null, array $config = []) {
		$queuedJob = [
			'job_type' => $jobType,
			'data' => is_array($data) ? serialize($data) : null,
			'job_group' => !empty($config['group']) ? $config['group'] : null,
			'notbefore' => !empty($config['notBefore']) ? $this->getDateTime($config['notBefore']) : null,
		] + $config;

		$queuedJob = $this->newEntity($queuedJob);

		return $this->saveOrFail($queuedJob);
	}
public function createJob($jobType, array $data = null, array $config = []) {
		$queuedJob = [
			'job_type' => $jobType,
			'data' => is_array($data) ? serialize($data) : null,
			'job_group' => !empty($config['group']) ? $config['group'] : null,
			'notbefore' => !empty($config['notBefore']) ? $this->getDateTime($config['notBefore']) : null,
		] + $config;

		$queuedJob = $this->newEntity($queuedJob);

		return $this->saveOrFail($queuedJob);
	}
public function createJob ( $ jobType , array $ data = null , array $ config = [ ] ) { $ queuedJob = [ 'job_type' => $ jobType , 'data' => is_array ( $ data ) ? serialize ( $ data ) : null , 'job_group' => ! empty ( $ config [ 'group' ] ) ? $ config [ 'group' ] : null , 'notbefore' => ! empty ( $ config [ 'notBefore' ] ) ? $ this -> getDateTime ( $ config [ 'notBefore' ] ) : null , ] + $ config ; $ queuedJob = $ this -> newEntity ( $ queuedJob ) ; return $ this -> saveOrFail ( $ queuedJob ) ; }
Adds a new job to the queue.

Config
- priority: 1-10, defaults to 5
- notBefore: Optional date which must not be preceded
- group: Used to group similar QueuedJobs
- reference: An optional reference string

@param string $jobType Job name
@param array|null $data Array of data
@param array $config Config to save along with the job
@return \Queue\Model\Entity\QueuedJob Saved job entity
Adds a new job to the queue .