本文整理汇总了PHP中SearchHelper::getWorkflowStates方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchHelper::getWorkflowStates方法的具体用法?PHP SearchHelper::getWorkflowStates怎么用?PHP SearchHelper::getWorkflowStates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchHelper
的用法示例。
在下文中一共展示了SearchHelper::getWorkflowStates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJSworkflowStruct
public static function getJSworkflowStruct($workflows = null)
{
if (is_null($workflows)) {
$workflows = SearchHelper::getWorkflows();
}
$workflow_str = '[';
$wo = 0;
foreach ($workflows as $workflow) {
if ($wo++ > 0) {
$workflow_str .= ',';
}
$wid = $workflow['id'];
$name = searchfix($workflow['name']);
$workflow_str .= "\n\t{id:\"{$wid}\", name: \"{$name}\", states: [ ";
$result['workflows'][$wid] = $workflow;
$states = SearchHelper::getWorkflowStates($wid);
$result['workflows'][$wid]['states'] = array();
$so = 0;
foreach ($states as $state) {
if ($so++ > 0) {
$workflow_str .= ',';
}
$sid = $state['id'];
$name = searchfix($state['name']);
$result['workflows'][$wid]['states'][$sid] = $state;
$workflow_str .= "\n\t\t{id:\"{$wid}\", name: \"{$name}\"}";
}
$workflow_str .= ']}';
}
$workflow_str .= ']';
return $workflow_str;
}