本文整理汇总了PHP中RuleAction::setFieldset方法的典型用法代码示例。如果您正苦于以下问题:PHP RuleAction::setFieldset方法的具体用法?PHP RuleAction::setFieldset怎么用?PHP RuleAction::setFieldset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuleAction
的用法示例。
在下文中一共展示了RuleAction::setFieldset方法的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;
}
}
}