本文整理汇总了PHP中complex_array::get_min_column_value方法的典型用法代码示例。如果您正苦于以下问题:PHP complex_array::get_min_column_value方法的具体用法?PHP complex_array::get_min_column_value怎么用?PHP complex_array::get_min_column_value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类complex_array
的用法示例。
在下文中一共展示了complex_array::get_min_column_value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: current
function _check_proper_nesting_strict($nodes, $level_limit=-1, $line='')
{
$l = complex_array :: get_min_column_value('l', $nodes, $index);
$r = complex_array :: get_max_column_value('r', $nodes, $index);
$node = current($nodes);
$this->assertEqual($node['l'], $l,
'l is invalid: ' . $node['l'] . ' , expected : ' . $l . ' at line: ' . $line);
$this->assertEqual($node['r'], $r,
'r is invalid: ' . $node['r'] . ' , expected : ' . $r . ' at line: ' . $line);
$children = ($r - $l - 1)/2;
if($children > 0)
{
$last_r = $this->_check_proper_nesting_recursive($nodes, $line, $l, $r, $children, $level_limit-1);
if($last_r !== false && sizeof($nodes) > $level_limit)
$this->assertEqual($node['r'] - $last_r, 1,
'there is a gap between r ' . $node['r'] . ' and r ' . $last_r . ' at line: ' . $line);
}
}
示例2: foreach
function _check_proper_nesting($nodes, $line='')
{
$paths[] = complex_array :: get_min_column_value('path', $nodes, $index);
$counter = 0;
foreach($nodes as $id => $node)
{
if($counter == 0)
{
$this->assertEqual($node['path'], $paths[0],
'first element path is invalid: ' . $node['path'] . ' , expected : ' . $paths[0] . ' at line: ' . $line);
}
elseif(preg_match('~^(.*/)[^/]+/$~', $node['path'], $matches))
{
$prev_path = $matches[1];
$this->assertTrue(in_array($prev_path, $paths),
'path is improperly nested: ' . $node['path'] . ' , expected parent not found: ' . $prev_path . ' at line: ' . $line);
}
else
{
$this->assertFalse(true, 'path is invalid: ' . $node['path'] . ' at line: ' . $line);
}
$paths[] = $node['path'];
$counter++;
}
}
示例3: array
function _check_proper_nesting($nodes, $line='')
{
$this->assertEqual(complex_array :: sort_array($nodes, array('path' => 'ASC')),
$nodes);
$path = complex_array :: get_min_column_value('path', $nodes, $index);
$parent_paths[] = $this->_get_parent_path($path);
$counter = 0;
foreach($nodes as $id => $node)
{
$parent_path = $this->_get_parent_path($node['path']);
$this->assertTrue(in_array($parent_path, $parent_paths),
'path is improperly nested: ' . $node['path'] . ' , expected parent not found: ' . $parent_path . ' at line: ' . $line);
$parent_paths[] = $node['path'];
}
}