Pimcore\Model\Schedule\Maintenance\Job::getId PHP Method

getId() public method

public getId ( ) : string
return string
    public function getId()
    {
        return $this->id;
    }

Usage Example

Example #1
0
 /**
  * @param Model\Schedule\Maintenance\Job $job
  * @param bool $force
  * @return bool
  */
 public function registerJob(Model\Schedule\Maintenance\Job $job, $force = false)
 {
     if (!empty($this->validJobs) and !in_array($job->getId(), $this->validJobs)) {
         Logger::info("Skipped job with ID: " . $job->getId() . " because it is not in the valid jobs.");
         return false;
     }
     if (!$job->isLocked() || $force || $this->getForce()) {
         $this->jobs[] = $job;
         Logger::info("Registered job with ID: " . $job->getId());
         return true;
     } else {
         Logger::info("Skipped job with ID: " . $job->getId() . " because it is still locked.");
     }
     return false;
 }