public function add(Ezer_Step &$step) { // overwrite any flow definition $step->in_flows = array(); $step->out_flows = array(); $sources = $step->getSources(); if ($sources && $sources instanceof Ezer_Array) { $arr_sources = (array) $sources; foreach ($arr_sources as $source) { $source_name = $source->getStepName(); $source_step =& $this->getStep($source_name); if ($source_step) { $source_step->setOutFlow($step); $step->setInFlow($source_step); } } } $targets = $step->getTargets(); if ($targets && $targets instanceof Ezer_Array) { $arr_targets = (array) $targets; foreach ($arr_targets as $target) { $target_name = $target->getStepName(); $target_step =& $this->getStep($target_name); if ($target_step) { $target_step->setInFlow($step); $step->setOutFlow($target_step); } } } parent::add($step); }
public function add(Ezer_Step &$step) { // overwrite any flow definition $step->in_flows = array(); $step->out_flows = array(); parent::add($step); $last_index = count($this->steps) - 1; if ($last_index <= 0) { return; } $last_step =& $this->steps[$last_index]; $prev_step =& $this->steps[$last_index - 1]; $last_step->in_flows[$prev_step->id] = $prev_step; $prev_step->out_flows[$last_step->id] = $last_step; }
public function add(Ezer_Step $value) { // overwrite any flow definition $value->in_flows = array(); $value->out_flows = array(); if ($value instanceof Ezer_If) { $value->canElse = false; $this->elseifs[] = $value; return; } if ($value instanceof Ezer_Else) { if (!$value->canElse) { throw new Ezer_SyntaxException('ElseIf object can not contain Else object'); } $this->else = $value; return; } if (count($this->steps)) { throw new Ezer_SyntaxException('If object can contain only on step'); } parent::add($value); }