Returns [
'JobType' => [
'YYYY-MM-DD' => INT,
...
]
]

@param string|null $jobType
@return array
345360
public function getFullStats($jobType = null) {
		$driverName = $this->_getDriverName();
		$fields = function (Query $query) use ($driverName) {
			$runtime = $query->newExpr('UNIX_TIMESTAMP(completed) - UNIX_TIMESTAMP(fetched)');
			switch ($driverName) {
				case static::DRIVER_SQLSERVER:
					$runtime = $query->newExpr("DATEDIFF(s, '1970-01-01 00:00:00', completed) - DATEDIFF(s, '1970-01-01 00:00:00', fetched)");
					break;
			}

			return [
				'job_type',
				'created',
				'duration' => $runtime,
			];
		};

		$conditions = ['completed IS NOT' => null];
		if ($jobType) {
			$conditions['job_type'] = $jobType;
		}

		$jobs = $this->find()
			->select($fields)
			->where($conditions)
			->enableHydration(false)
			->orderDesc('id')
			->limit(static::STATS_LIMIT)
			->all()
			->toArray();

		$result = [];

		$days = [];

		foreach ($jobs as $job) {
			/** @var \DateTime $created */
			$created = $job['created'];
			$day = $created->format('Y-m-d');
			if (!isset($days[$day])) {
				$days[$day] = $day;
			}

			$result[$job['job_type']][$day][] = $job['duration'];
		}

		foreach ($result as $jobType => $jobs) {
			foreach ($jobs as $day => $durations) {
				$average = array_sum($durations) / count($durations);
				$result[$jobType][$day] = (int)$average;
			}

			foreach ($days as $day) {
				if (isset($result[$jobType][$day])) {
					continue;
				}

				$result[$jobType][$day] = 0;
			}
		}

		return $result;
	}
580280
public function find($jobId)
    {
        $data = $this->redis->get($this->namespace . $jobId);
        $data = json_decode($data, true);

        $jobClass = $data[AbstractJob::P_JOB_CLASS];

        /** @var AbstractJob $job */
        $job = new $jobClass($data);

        return $job;
    }
637309
public function getJobType() {
		$sourceObject = ExternalContent::getDataObjectFor($this->sourceObjectID);
		if (!$sourceObject) {
			$this->addMessage("ERROR: Source object $this->sourceObjectID cannot be found");
			return QueuedJob::QUEUED;
		}

		// go a couple levels deep and see how many items we're looking at
		if (!$this->includeChildren) {
			return QueuedJob::QUEUED;
		}

		$children = $sourceObject->stageChildren();
		if (!$children) {
			return QueuedJob::QUEUED;
		}
		$count = 1;

		foreach ($children as $child) {
			$count++;
			if ($count > 20) {
				$this->totalSteps = $count;
				return QueuedJob::QUEUED;
			}

			$subChildren = $child->stageChildren();
			if ($subChildren) {
				foreach ($subChildren as $sub) {
					$count++;
					if ($count > 20) {
						$this->totalSteps = $count;
						return QueuedJob::QUEUED;
					}
				}
			}
		}
		$this->totalSteps = $count;
		return QueuedJob::QUEUED;
	}
1045842
public function getIncomingDependencies(Job $job)
    {
        $jobIds = $this->getJobIdsOfIncomingDependencies($job);
        if (empty($jobIds)) {
            return [];
        }

        return $this->_em->createQuery('SELECT j FROM JMSJobQueueBundle:Job j WHERE j.id IN (:ids)')
            ->setParameter('ids', $jobIds)
            ->getResult();
    }
839341
public function getCallbacksByType($type)
    {
        if (array_key_exists($type, $this->callbacks) && count($this->callbacks[$type]) > 0) {
            return $this->callbacks[$type];
        }

        return [];
    }
539962
public function getLength($type = null) {
		$findConf = [
			'conditions' => [
				'completed IS' => null,
			],
		];
		if ($type !== null) {
			$findConf['conditions']['job_type'] = $type;
		}

		return $this->find('all', $findConf)->count();
	}
25224
public function getEmptyValue(string $type)
    {
        $type = strtolower($type);
        $typeToValue = [
            'date' => '1970-01-01',
            'datetime' => '1970-01-01 00:00:00',
            'time' => '00:00:00',
            'smallint' => 0,
            'integer' => 0,
            'bigint' => 0,
            'float' => 0,
            'decimal' => 0,
        ];

        // Value is simply an empty string
        if (!array_key_exists($type, $typeToValue)) {
            return '';
        }

        return $typeToValue[$type];
    }
816673
public function getBatchResult($jobId)
    {
        $result = $this->httpGet(self::WECHAT_BATCH_RESULT_GET_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'jobid' => $jobId
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok' ? $result : $this->dump($result);
    }
891188
public function getJobList()
    {
        $propertyList = $this->_getEntityList('Jobs');
        $result = [];

        foreach ($propertyList as $properties) {
            $result[] = Job::createFromOptions($properties);
        }

        return $result;
    }
300297
public function display($type = null) : string
    {
        if ($type == self::DISPLAY_DURATION) {
            return $this->diffForHumans(self::now(), true);
        }

        if (is_null($type)) {
            $type = [self::DISPLAY_SHORT, self::DISPLAY_SHORT];
        } elseif (!is_array($type)) {
            $type = [$type, $type];
        } elseif (is_array($type)) {
            if (!isset($type[1])) {
                return Calendar::formatDate($this->toMutable(), $type[0]);
            } elseif (is_null($type[0])) {
                return Calendar::formatTime($this->toMutable(), $type[1]);
            }
        }

        return Calendar::formatDatetime($this->toMutable(), implode('|', $type));
    }
228440
public function defaultPickerOptions()
    {
        $date = null;

        if ($this->inputVal() !== '') {
            $date = new \DateTime($this->inputVal());
        }

        return [
            'format'      => self::DEFAULT_JS_FORMAT,
            'defaultDate' => $date ? $date->format(\DateTime::ISO8601) : null
        ];
    }
648120
public function job()
    {
        $job = $this->resque->getClient()->get($this->getJobKey());

        if (!$job) {
            return array();
        } else {
            return json_decode($job, true);
        }
    }
1066371
public function getQueuedJobs($all = false)
    {
        $background = [];
        $foreground = [];
        foreach ($this->jobs as $job) {
            if ($all || $job->getEnabled()) {
                if ($job->runInBackground()) {
                    $background[] = $job;
                } else {
                    $foreground[] = $job;
                }
            }

        }
        return [$background, $foreground];
    }
144008
public function getJobFromId($identifier)
    {
        return array_key_exists($identifier, $this->identifierToId)
            ? $this->jobs[$identifier]
            : null;
    }
61401
private function resolveAndAddType(JobTypeInterface $type)
    {
        $parentType = $type->getParent();

        if ($parentType instanceof JobTypeInterface) {
            $this->resolveAndAddType($parentType);
            $parentType = $parentType->getName();
        }

        $typeExtensions = array();

        foreach ($this->extensions as $extension) {
            /* @var FormExtensionInterface $extension */
            $typeExtensions = array_merge(
                $typeExtensions,
                $extension->getTypeExtensions($type->getName())
            );
        }

        $this->types[$type->getName()] = new ResolvedJob(
            $type, 
            $typeExtensions,
            $parentType ? $this->getType($parentType) : null
        );
    }
475866
public function get($job_id)
    {
        $result = null;
        $this->hook->attach('job.get.before', $job_id, $result, $this);

        if (isset($result)) {
            return $result;
        }

        $result = $this->getSession($job_id);
        $this->hook->attach('job.get.after', $job_id, $result, $this);
        return $result;
    }
558450
public function getJob($jobId)
    {
        $requestData = $this->getDefaultRequestData('query', []);
        return $this->sendRequest('jobs/' . $jobId, $requestData, self::HTTP_METHOD_GET);
    }