本文整理匯總了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;
}