當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。