当前位置: 首页>>代码示例>>PHP>>正文


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怎么用?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);
		}
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:23,代码来源:nested_sets_driver_test.class.php

示例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++;
    }
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:materialized_path_driver_test.class.php

示例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'];
    }
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:19,代码来源:materialized_path_tree_test.class.php


注:本文中的complex_array::get_min_column_value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。