public function testResolveStructureToPHPString()
 {
     $this->assertEquals('1', WorkflowTriggersUtil::resolveStructureToPHPString('1'));
     $this->assertEquals('1 && 2', WorkflowTriggersUtil::resolveStructureToPHPString('1 AND 2'));
     $this->assertEquals('1 || 2', WorkflowTriggersUtil::resolveStructureToPHPString('1 OR 2'));
     $this->assertEquals('(1 || 2) && 3', WorkflowTriggersUtil::resolveStructureToPHPString('(1 OR 2) AND 3'));
     $this->assertEquals('1 && 2 && 3', WorkflowTriggersUtil::resolveStructureToPHPString('1 AND 2 AND 3'));
 }
 /**
  * @param Workflow $workflow
  * @param RedBeanModel $model
  * @return bool|void
  */
 protected static function resolveTriggersAreTrueBeforeSave(Workflow $workflow, RedBeanModel $model)
 {
     if (count($workflow->getTriggers()) == 0) {
         return true;
     }
     $structureAsPHPString = WorkflowTriggersUtil::resolveStructureToPHPString($workflow->getTriggersStructure());
     $dataToEvaluate = array();
     $count = 0;
     foreach ($workflow->getTriggers() as $trigger) {
         $dataToEvaluate[$count + 1] = self::isTriggerTrueByModel($workflow, $trigger, $model);
         $count++;
     }
     $phpStringReadyToEvaluate = WorkflowTriggersUtil::resolveBooleansDataToPHPString($structureAsPHPString, $dataToEvaluate);
     return WorkflowTriggersUtil::evaluatePHPString($phpStringReadyToEvaluate);
 }