Beispiel #1
0
 /**
  * @return bool
  */
 public function prepare()
 {
     if ($this->stages->count() === 0) {
         $this->logger->warning("Job has no stages, cannot continue");
         return false;
     }
     foreach ($this->stages as $n => $stage) {
         $this->stageMapping[$stage->getName()] = $n + 1;
         $stage->setJobHandler($this);
         $stage->setLogger($this->logger);
     }
     $this->logger->debug("Prepared Job with {$this->stages->count()} stages");
     return true;
 }
Beispiel #2
0
 /**
  * Adds a stage.
  *
  * @param Stage $stage Stage
  *
  * @return $this
  */
 public function addStage(Stage $stage)
 {
     $this->stages->attach($stage);
     return $this;
 }