本文整理汇总了PHP中tree::get_subtree方法的典型用法代码示例。如果您正苦于以下问题:PHP tree::get_subtree方法的具体用法?PHP tree::get_subtree怎么用?PHP tree::get_subtree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tree
的用法示例。
在下文中一共展示了tree::get_subtree方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dBug
echo "<pre> tree - get_available_node_types()";
echo "</pre>";
$available_node_types = $tree_mgr->get_available_node_types();
new dBug($available_node_types);
echo "<pre> tree - get_node_hierarchy_info(\$node_id)";
echo "</pre>";
$node_id = 1;
echo "<pre> get_node_hierarchy_info({$node_id})";
echo "</pre>";
$node_hierachy_info = $tree_mgr->get_node_hierarchy_info($node_id);
new dBug($node_hierachy_info);
echo "<pre> tree - get_subtree(\$node_id)";
echo "</pre>";
echo "<pre> get_subtree({$node_id})";
echo "</pre>";
$subtree = $tree_mgr->get_subtree($node_id);
new dBug($subtree);
echo "<pre> tree - get_subtree(\$node_id,\$exclude_node_types=null," . "<br>" . " \$exclude_children_of=null,\$exclude_branches=null," . "<br>" . " \$and_not_in_clause='',\$bRecursive = false)";
echo "</pre>";
echo "<pre> get_subtree({$node_id},null,null,null,'',false)";
echo "</pre>";
$subtree = $tree_mgr->get_subtree($node_id, null, null, null, '', false);
new dBug($subtree);
echo "<pre> get_subtree({$node_id},null,null,null,'',true)";
echo "</pre>";
$subtree = $tree_mgr->get_subtree($node_id, null, null, null, '', true);
new dBug($subtree);
echo "<pre> tree - get_subtree_list(\$node_id)";
echo "</pre>";
echo "<pre> get_subtree_list({$node_id})";
echo "</pre>";
示例2: remote_exec_testcase_set
function remote_exec_testcase_set(&$db, $parent_id, $msg)
{
$cfield_manager = new cfield_mgr($db);
$tree_manager = new tree($db);
$xmlResponse = null;
$executionResults = array();
$node_type = $tree_manager->get_available_node_types();
$subtree_list = $tree_manager->get_subtree($parent_id);
foreach ($subtree_list as $_key => $_value) {
if (is_array($_value)) {
if ($_value['node_type_id'] == $node_type['testcase']) {
$executionResults[$_value['id']] = executeTestCase($_value['id'], $tree_manager, $cfield_manager);
} else {
//Can add some logic here. If required.
continue;
}
}
}
if ($executionResults) {
foreach ($executionResults as $key => $value) {
$node_info = $tree_manager->get_node_hierarchy_info($key);
$xmlResponse .= '<tr><th colspan="2">' . lang_get('tcexec_results_for') . $node_info['name'] . "</th></tr>";
$serverTest = 1;
foreach ($value as $_key => $_value) {
if ($_value != -1) {
$xmlResponse .= "<tr><td>" . $_key . ":</td><td>" . $_value . "</td></tr>";
} else {
$serverTest = $serverTest + 1;
}
}
if ($serverTest != 1) {
$xmlResponse .= $xmlResponse .= $msg['check_server_setting'];
}
}
}
return $xmlResponse;
}