Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * 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;
 }
Пример #3
0
 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);
         }
     }
 }