本文整理汇总了PHP中CBPHelper::MakeArrayFlat方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPHelper::MakeArrayFlat方法的具体用法?PHP CBPHelper::MakeArrayFlat怎么用?PHP CBPHelper::MakeArrayFlat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPHelper
的用法示例。
在下文中一共展示了CBPHelper::MakeArrayFlat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ParseDocumentTypeStates
private static function ParseDocumentTypeStates($arTemplatesListItem)
{
$arWorkflowTemplate = $arTemplatesListItem["TEMPLATE"];
if (!is_array($arWorkflowTemplate)) {
throw new CBPArgumentTypeException("arTemplatesListItem");
}
$result = array("ID" => "", "TEMPLATE_ID" => $arTemplatesListItem["ID"], "TEMPLATE_NAME" => $arTemplatesListItem["NAME"], "TEMPLATE_DESCRIPTION" => $arTemplatesListItem["DESCRIPTION"], "STATE_NAME" => "", "STATE_TITLE" => "", "TEMPLATE_PARAMETERS" => $arTemplatesListItem["PARAMETERS"], "STATE_PARAMETERS" => array(), "STATE_PERMISSIONS" => array(), "WORKFLOW_STATUS" => -1);
$type = "CBP" . $arWorkflowTemplate[0]["Type"];
$bStateMachine = false;
while (strlen($type) > 0) {
if ($type == "CBPStateMachineWorkflowActivity") {
$bStateMachine = true;
break;
}
$type = get_parent_class($type);
}
if ($bStateMachine) {
//if (strlen($stateName) <= 0)
$stateName = $arWorkflowTemplate[0]["Properties"]["InitialStateName"];
if (is_array($arWorkflowTemplate[0]["Children"])) {
foreach ($arWorkflowTemplate[0]["Children"] as $state) {
if ($stateName == $state["Name"]) {
$result["STATE_NAME"] = $stateName;
$result["STATE_TITLE"] = $state["Properties"]["Title"];
$result["STATE_PARAMETERS"] = array();
$result["STATE_PERMISSIONS"] = $state["Properties"]["Permission"];
if (is_array($state["Children"])) {
foreach ($state["Children"] as $event) {
if ($event["Type"] == "EventDrivenActivity") {
if ($event["Children"][0]["Type"] == "HandleExternalEventActivity") {
$result["STATE_PARAMETERS"][] = array("NAME" => $event["Children"][0]["Name"], "TITLE" => $event["Children"][0]["Properties"]["Title"], "PERMISSION" => $event["Children"][0]["Properties"]["Permission"]);
}
}
}
}
break;
}
}
}
} else {
$result["STATE_PERMISSIONS"] = $arWorkflowTemplate[0]["Properties"]["Permission"];
}
if (is_array($result["STATE_PERMISSIONS"])) {
$arKeys = array_keys($result["STATE_PERMISSIONS"]);
foreach ($arKeys as $key) {
$ar = self::ExtractValuesFromVariables($result["STATE_PERMISSIONS"][$key], $arTemplatesListItem["VARIABLES"], $arTemplatesListItem["CONSTANTS"]);
$result["STATE_PERMISSIONS"][$key] = CBPHelper::MakeArrayFlat($ar);
}
}
return $result;
}