/** * Gather all verificator in current group * * @return \Docoflow\Entity\Verificator */ public function gatherVerificators() { $verificators = new Verificator(); foreach ($this as $group) { $verificators->assign($group->getRelated('verificators')); } return $verificators; }
/** * Prepare data before saving * * @return \Docoflow\Docoflow */ public function prepare() { if (!$this->step) { throw new Exception('Cannot create workflow, steps are empty.'); } $steps = $this->step->rebuild(); if (!$this->group) { throw new Exception('Cannot create workflow, groups are empty.'); } $this->group->rebuild($steps); if (!$this->verificator) { throw new Exception('Cannot create workflow, verificators are empty.'); } $this->verificator->rebuild($steps); $this->prepared = $steps; return $this; }
protected function makeInternalVerificators() { $this->bootstrapped->set('verificators', true); if (!$this->groups) { if (!$this->bootstrapped->groups) { $this->makeInternalGroups(); } else { return; } } $this->verificators = new Verificator(); foreach ($this->groups as $group) { foreach ($group->getRelated('verificators') as $verificator) { $this->verificators->push($verificator); } } }