/**
  * @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);
 }
 /**
  * @expectedException NotSupportedException
  */
 public function testResolveBooleansDataToPHPStringWithInvalidDataValue()
 {
     $data = array(1 => null);
     $this->assertEquals('true', WorkflowTriggersUtil::resolveBooleansDataToPHPString('1', $data));
 }