当前位置: 首页>>代码示例>>PHP>>正文


PHP RuleAction::setValue方法代码示例

本文整理汇总了PHP中RuleAction::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP RuleAction::setValue方法的具体用法?PHP RuleAction::setValue怎么用?PHP RuleAction::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RuleAction的用法示例。


在下文中一共展示了RuleAction::setValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadEntities


//.........这里部分代码省略.........
             $this->setDynamic(false);
         }
     }
     if ($simulator->Sites) {
         foreach ($simulator->Sites->Site as $site) {
             $siteObj = new Site($this, (int) $site['id'], (string) $site['name'], (string) $site['home']);
             $this->sites[] = $siteObj;
         }
     }
     if ($simulator->Sources) {
         foreach ($simulator->Sources->Source as $source) {
             $sourceObj = new Source($this, (int) $source['id'], (string) $source['datasource'], (string) $source['returnType']);
             $sourceObj->setRequest((string) $source['request']);
             $sourceObj->setSeparator((string) $source['separator']);
             $sourceObj->setDelimiter((string) $source['delimiter']);
             $sourceObj->setReturnPath((string) $source['returnPath']);
             foreach ($source->Parameter as $parameter) {
                 $parameterObj = new Parameter($sourceObj, (string) $parameter['type']);
                 $parameterObj->setName((string) $parameter['name']);
                 $parameterObj->setFormat((string) $parameter['format']);
                 $parameterObj->setData((int) $parameter['data']);
                 $sourceObj->addParameter($parameterObj);
             }
             $this->sources[] = $sourceObj;
         }
     }
     if ($simulator->BusinessRules) {
         foreach ($simulator->BusinessRules->BusinessRule as $brule) {
             $businessRuleObj = new BusinessRule($this, 'rule-' . mt_rand(), (int) $brule['id'], (string) $brule['name']);
             $businessRuleObj->setLabel((string) $brule['label']);
             $businessRuleObj->setConditions((string) $brule->Conditions['value']);
             if (preg_match_all("/#(\\d+)/", (string) $brule->Conditions['value'], $matches)) {
                 foreach ($matches[1] as $id) {
                     $data = $this->getDataById($id);
                     $data->addRuleDependency((int) $brule['id']);
                 }
             }
             if ($brule->Conditions->Condition) {
                 $businessRuleObj->setConnector($this->loadConnector($brule->Conditions->Condition));
             } else {
                 if ($brule->Conditions->Connector) {
                     $businessRuleObj->setConnector($this->loadConnector($brule->Conditions->Connector));
                 }
             }
             foreach ($brule->IfActions->Action as $action) {
                 $ruleActionObj = new RuleAction((int) $action['id'], (string) $action['name']);
                 $ruleActionObj->setTarget((string) $action['target']);
                 $ruleActionObj->setData((string) $action['data']);
                 $ruleActionObj->setDatagroup((string) $action['datagroup']);
                 $ruleActionObj->setStep((string) $action['step']);
                 $ruleActionObj->setPanel((string) $action['panel']);
                 $ruleActionObj->setFieldset((string) $action['fieldset']);
                 $ruleActionObj->setField((string) $action['field']);
                 $ruleActionObj->setBlockinfo((string) $action['blockinfo']);
                 $ruleActionObj->setChapter((string) $action['chapter']);
                 $ruleActionObj->setSection((string) $action['section']);
                 $ruleActionObj->setPrenote((string) $action['prenote']);
                 $ruleActionObj->setPostnote((string) $action['postnote']);
                 $ruleActionObj->setFootnote((string) $action['footnote']);
                 $ruleActionObj->setAction((string) $action['action']);
                 $ruleActionObj->setChoice((string) $action['choice']);
                 $ruleActionObj->setValue((string) $action['value']);
                 $businessRuleObj->addIfAction($ruleActionObj);
                 if ((string) $action['name'] == "setAttribute" && preg_match_all("/#(\\d+)/", (string) $action['value'], $matches)) {
                     foreach ($matches[1] as $id) {
                         $data = $this->getDataById($id);
                         $data->addRuleDependency((int) $brule['id']);
                     }
                 }
             }
             foreach ($brule->ElseActions->Action as $action) {
                 $ruleActionObj = new RuleAction((int) $action['id'], (string) $action['name']);
                 $ruleActionObj->setTarget((string) $action['target']);
                 $ruleActionObj->setData((string) $action['data']);
                 $ruleActionObj->setDatagroup((string) $action['datagroup']);
                 $ruleActionObj->setStep((string) $action['step']);
                 $ruleActionObj->setPanel((string) $action['panel']);
                 $ruleActionObj->setFieldset((string) $action['fieldset']);
                 $ruleActionObj->setField((string) $action['field']);
                 $ruleActionObj->setBlockinfo((string) $action['blockinfo']);
                 $ruleActionObj->setChapter((string) $action['chapter']);
                 $ruleActionObj->setSection((string) $action['section']);
                 $ruleActionObj->setPrenote((string) $action['prenote']);
                 $ruleActionObj->setPostnote((string) $action['postnote']);
                 $ruleActionObj->setFootnote((string) $action['footnote']);
                 $ruleActionObj->setAction((string) $action['action']);
                 $ruleActionObj->setChoice((string) $action['choice']);
                 $ruleActionObj->setValue((string) $action['value']);
                 $businessRuleObj->addElseAction($ruleActionObj);
                 if ((string) $action['name'] == "setAttribute" && preg_match_all("/#(\\d+)/", (string) $action['value'], $matches)) {
                     foreach ($matches[1] as $id) {
                         $data = $this->getDataById($id);
                         $data->addRuleDependency((int) $brule['id']);
                     }
                 }
             }
             $this->businessrules[] = $businessRuleObj;
         }
     }
 }
开发者ID:eureka2,项目名称:g6k,代码行数:101,代码来源:Simulator.php


注:本文中的RuleAction::setValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。