public function ContinuousManager::hasContinuousJobs

Checks if there is any continuous job.

Return value

bool Returns TRUE if there is continuous job, FALSE otherwise.

File

src/ContinuousManager.php, line 78

Class

ContinuousManager
A service manager for continuous jobs.

Namespace

Drupal\tmgmt

Code

public function hasContinuousJobs() {
  $id = $this->entityTypeManager
    ->getStorage('tmgmt_job')
    ->getQuery()
    ->accessCheck(TRUE)
    ->condition('job_type', Job::TYPE_CONTINUOUS)
    ->range(0, 1)
    ->execute();
  return !empty($id);
}