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


PHP complex_array::get_column_values方法代码示例

本文整理汇总了PHP中complex_array::get_column_values方法的典型用法代码示例。如果您正苦于以下问题:PHP complex_array::get_column_values方法的具体用法?PHP complex_array::get_column_values怎么用?PHP complex_array::get_column_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在complex_array的用法示例。


在下文中一共展示了complex_array::get_column_values方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instance

	function & _fetch(&$counter, $params)
	{
		if(!$result =& parent :: _fetch($counter, $params))
			return $result;
		
		$user_ids = complex_array :: get_column_values('user_id', $result);

		$fetcher =& fetcher :: instance();
		
		$params = array(
			'restrict_by_class' => false
		);
		
		$user_counter = 0;
		$users =& $fetcher->fetch_by_ids($user_ids, 'user_object', $user_counter, $params, 'fetch_by_ids');

		foreach($result as $key => $data)
		{
			if (!isset($users[$data['user_id']]))
				continue;
				
			$customer_data = $users[$data['user_id']];
			$result[$key]['user_name'] = $customer_data['name'];
			$result[$key]['user_lastname'] = $customer_data['lastname'];
			$result[$key]['user_secondname'] = $customer_data['secondname'];
			$result[$key]['user_email'] = $customer_data['email'];
			$result[$key]['user_phone'] = $customer_data['phone'];
		}	

		return $result;
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:31,代码来源:simple_orders_list_datasource.class.php

示例2: array

	function & get_dataset(&$counter, $params=array())
	{
		$counter = 0;
		
		$mapped_node = map_request_to_node();
		
		$links_manager = new links_manager();
		
		$groups = array();
		
		if(isset($params['group_identifier']))
		{
		  if($group = $links_manager->fetch_group_by_identifier($params['group_identifier']))
		    $groups[$group['id']] = $group;
		}
		else
		  $groups = $links_manager->fetch_groups();

		if (!is_array($groups) || !count($groups))
		  return new empty_dataset();

		if(isset($params['back_links']) && $params['back_links'])
		  $links = $links_manager->fetch_back_links($mapped_node['id'], array_keys($groups));
		else
		  $links = $links_manager->fetch_target_links($mapped_node['id'], array_keys($groups));

		if (!is_array($links) || !count($links))
		  return new array_dataset($groups);
		
		$target_node_ids = complex_array :: get_column_values('target_node_id', $links);
				
		if (!is_array($target_node_ids) || !count($target_node_ids))
		  return new array_dataset($groups);

		$site_object_class_name = isset($params['loader_class_name']) ? $params['loader_class_name'] : 'site_object';
		$objects =& fetch_by_node_ids($target_node_ids, $site_object_class_name, $counter, array(
		  'restrict_by_class' => false
		));
		
		$result = array();
		
		foreach($groups as $group_id => $group)
		{
      $groups[$group_id]['links'] = array();
      
		  foreach($links as $link_id => $link)
		  {
		    if ($link['group_id']!= $group_id)
		      continue;
		    
		    //if (!isset($objects[$link['target_node_id']]))
		    //  continue;
        
        $link_data = array_merge($objects[$link['target_node_id']], $link);
        $groups[$group_id]['links'][$link_id] = $link_data;
		  }
		}
		
		return new array_dataset($groups);
	}		
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:60,代码来源:node_links_datasource.class.php

示例3: array

 function &fetch_sub_branch($path, $loader_class_name, &$counter, $params = array(), $fetch_method = 'fetch_by_ids')
 {
     $tree =& limb_tree::instance();
     $site_object =& site_object_factory::instance($loader_class_name);
     if (!isset($params['restrict_by_class']) || isset($params['restrict_by_class']) && (bool) $params['restrict_by_class']) {
         $class_id = $site_object->get_class_id();
     } else {
         $class_id = null;
     }
     if (isset($params['check_expanded_parents'])) {
         $check_expanded_parents = (bool) $params['check_expanded_parents'];
     } else {
         $check_expanded_parents = false;
     }
     if (isset($params['include_parent'])) {
         $include_parent = (bool) $params['include_parent'];
     } else {
         $include_parent = false;
     }
     $depth = isset($params['depth']) ? $params['depth'] : 1;
     if (!($nodes = $tree->get_accessible_sub_branch_by_path($path, $depth, $include_parent, $check_expanded_parents, $class_id))) {
         return array();
     }
     $object_ids = complex_array::get_column_values('object_id', $nodes);
     if (!count($object_ids)) {
         return array();
     }
     $result =& $this->fetch_by_ids($object_ids, $loader_class_name, $counter, $params, $fetch_method);
     return $result;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:30,代码来源:fetcher.class.php

示例4: get_max_column_value

 function get_max_column_value($column_name, $array, &$index)
 {
     $index = 0;
     if (!($values = complex_array::get_column_values($column_name, $array))) {
         return false;
     }
     $max = max($values);
     $index = array_search($max, $values);
     return $max;
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:complex_array.class.php

示例5: get_classes_list

 function get_classes_list()
 {
     $project_db = str_replace('_tests', '', DB_NAME);
     $db =& db_factory::instance();
     $db->select_db($project_db);
     $db->sql_select('sys_class', '*', 'class_name != "site_object"');
     $list = $db->get_array();
     $db->select_db(DB_NAME);
     return complex_array::get_column_values('class_name', $list);
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:10,代码来源:project_site_objects_loader.class.php

示例6: _check_db_table

 function _check_db_table($db_table)
 {
     $table_name = $db_table->get_table_name();
     $primary_key_name = $db_table->get_primary_key_name();
     $columns = $db_table->get_columns();
     $this->db->sql_exec('SHOW TABLES LIKE "' . $table_name . '"');
     if (!($res = $this->db->fetch_row())) {
         //???
         return;
     }
     $this->assertEqual(sizeof($res), 1, $table_name . ' doesnt exist in db');
     $this->db->sql_exec('SHOW COLUMNS FROM ' . $table_name);
     $db_columns = $this->db->get_array();
     $a1 = complex_array::get_column_values('Field', $db_columns);
     $a2 = array_keys($columns);
     foreach ($a1 as $column) {
         $this->assertTrue(in_array($column, $a2), $table_name . ' column "' . $column . '" not in db');
     }
     $db_primary_key_name = '';
     foreach ($db_columns as $db_column) {
         if ($db_column['Key'] == 'PRI') {
             $db_primary_key_name = $db_column['Field'];
         }
         $status_string = 'db table:"' . $table_name . '"  field definition:"' . $db_column['Field'] . ' does not exist in class';
         $this->assertTrue(in_array($db_column['Field'], array_keys($columns)), $status_string);
         $type = $db_table->get_column_type($db_column['Field']);
         $status_string = 'db table:"' . $table_name . '"  column:"' . $db_column['Field'] . '"  db type: "' . $db_column['Type'] . '" expected: ';
         switch ($type) {
             case '':
             case 'string':
                 $this->assertWantedPattern('/char|text/', $db_column['Type'], $status_string . 'string');
                 break;
             case 'blob':
                 $this->assertWantedPattern('/blob/', $db_column['Type'], $status_string . 'blob');
                 break;
             case 'numeric':
                 $this->assertWantedPattern('/int|double|dec|float/', $db_column['Type'], $status_string . 'numeric');
                 break;
             case 'float':
                 $this->assertWantedPattern('/float/', $db_column['Type'], $status_string . 'float');
                 break;
             case 'date':
                 $this->assertWantedPattern('/date/', $db_column['Type'], $status_string . 'date');
                 break;
             default:
                 $this->assertTrue(false, 'Unknown type: ' . $status_string);
         }
     }
     if ($primary_key_name) {
         $this->assertEqual($db_primary_key_name, $primary_key_name, 'table ' . $table_name . ': ' . $primary_key_name . ' primary key not found');
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:52,代码来源:project_db_tables_test.class.php

示例7: array

  function _do_sort(& $tree_array, & $sorted_tree_array, $sort_params, $parent_id, $id_hash, $parent_hash)
  {
 		$children = array();
 		
  	foreach($tree_array as $index => $item)
  	{
  		if($item[$parent_hash] == $parent_id)
  		{
  			$children[] = $item;
  			unset($tree_array[$index]);
  		}
  	}

  	if(!($count = sizeof($children)))
  		return;
		
		$children = complex_array :: sort_array($children, $sort_params);
		
		if(!$sorted_tree_array)
		{
			$sorted_tree_array = $children;
		}
		else
		{
			$ids = complex_array :: get_column_values($id_hash, $sorted_tree_array);
			
			$offset = array_search($parent_id, $ids) + 1;
			
			array_splice($sorted_tree_array, $offset, 0, $children);
		}
		
    for($i=0; $i < $count; $i++)
    {
	   	tree_sorter :: _do_sort($tree_array, $sorted_tree_array, $sort_params, $children[$i][$id_hash], $id_hash, $parent_hash);
    }
  }  
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:36,代码来源:tree_sorter.class.php

示例8: array

	function assign_actions_to_objects(&$objects)
	{
		$controllers = array();
		$permitted_actions = array();
		
		if(isset($objects['id']))
		{
			$available_permissions = $this->_load_objects_available_permissions(array($objects['id']));
			$arr[] =& $objects;
		}
		else
		{
			$available_permissions = $this->_load_objects_available_permissions(complex_array :: get_column_values('id', $objects));
			$arr =& $objects;
		}
		
		foreach($arr as $key => $data)
		{
			$class_id = $data['class_id'];
			
			$arr[$key]['actions'] = array();
						
			if (!isset($actions_definitions[$class_id]))
			{
				$site_object_controller =& $this->_get_controller($data['class_name']);
				$actions_definitions[$class_id] = $site_object_controller->get_actions_definitions();
			}	

			if (!isset($permitted_type_actions[$class_id]))
				$permitted_actions[$class_id] = $this->_get_type_accessible_actions($class_id);
			
			$permitted_type_actions =& $permitted_actions[$class_id];			
			$all_actions =  $actions_definitions[$class_id];

			if (!isset($available_permissions[$data['id']]))
				continue;
				
			$object_available_permissions = $available_permissions[$data['id']];

			foreach($all_actions as $action_name => $action_params)
			{
				if (!isset($action_params['permissions_required']))
				{
			   	error('action permissions not set',
		    		 __FILE__ . ' : ' . __LINE__ . ' : ' .  __FUNCTION__, 
		    		array(
		    			'site_object_controller' => $controller_class_name,
		    			'action' => $action_name,
	    			)
		    	);
				}
				
				if ((($action_params['permissions_required'] == 'r' && $object_available_permissions['r'] > 0)
				 || ($action_params['permissions_required'] == 'w' && $object_available_permissions['w'] > 0)
				 || ($action_params['permissions_required'] == 'rw' && ($object_available_permissions['w'] > 0 && $object_available_permissions['r'] > 0)))
				&& (isset($permitted_type_actions[$action_name])))
				{
					$arr[$key]['actions'][$action_name] = $action_params;
				}	
			}			
		}
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:62,代码来源:access_policy.class.php

示例9:

	function _delete_operation($conditions, $affected_rows)
	{
		parent :: _delete_operation($conditions, $affected_rows);
		
		$this->_delete_media_files(complex_array :: get_column_values('id', $affected_rows));
	}	
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:6,代码来源:media_db_table.class.php

示例10: array

	function & fetch_sub_branch($path, $loader_class_name, &$counter, $params = array(), $fetch_method = 'fetch_by_ids')
	{		
		$tree =& tree :: instance();
		$site_object =& site_object_factory :: instance($loader_class_name);
		
		if ($loader_class_name != 'site_object' &&
				!isset($params['restrict_by_class']) ||
				(isset($params['restrict_by_class']) && (bool)$params['restrict_by_class']))
			$class_id = $site_object->get_class_id();
		else
			$class_id = null;
		
		if (isset($params['check_expanded_parents']))
			$check_expanded_parents = (bool)$params['check_expanded_parents'];
		else
			$check_expanded_parents = false;
			
		if (isset($params['include_parent']))
			$include_parent = (bool)$params['include_parent'];
		else
			$include_parent = false;

		if (isset($params['only_parents']))
			$only_parents = (bool)$params['only_parents'];
		else
			$only_parents = false;
		
		$depth = isset($params['depth']) ? $params['depth'] : 1;	
		
		if(!$nodes = $tree->get_accessible_sub_branch_by_path($path, $depth, $include_parent, $check_expanded_parents, $class_id, $only_parents))
			return array();
						
		if(!$object_ids = complex_array :: get_column_values('object_id', $nodes))
			return array();
				
		$objects_data =& $this->fetch_by_ids($object_ids, $loader_class_name, $counter, $params, $fetch_method);
		
		return $objects_data;
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:39,代码来源:fetcher.class.php

示例11: min

  function get_min_column_value($column_name, $array, &$index)
  {
    $index = 0;

    if(!$values = complex_array :: get_column_values($column_name, $array))
      return false;

    $min = min($values);

    $index = array_search($min, $values);

    return $min;
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:13,代码来源:complex_array.class.php

示例12: remove

 function remove(&$site_object)
 {
     $indexer =& indexer::instance();
     $indexer->db =& db_factory::instance();
     $object_id = $site_object->get_id();
     $indexer->db->sql_exec("SELECT word_id FROM sys_word_link WHERE object_id='{$object_id}'");
     $word_array =& $indexer->db->get_array();
     $word_ids_array = complex_array::get_column_values('word_id', $word_array);
     if (count($word_ids_array) > 0) {
         $word_id_string = implode(',', $word_ids_array);
         if (count($word_ids_array) > 0) {
             $indexer->db->sql_exec("UPDATE sys_word SET object_count=( object_count - 1 ) WHERE id in ( {$word_id_string} )");
         }
         $indexer->db->sql_exec("DELETE FROM sys_word WHERE object_count='0'");
         $indexer->db->sql_exec("DELETE FROM sys_word_link WHERE object_id='{$object_id}'");
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:17,代码来源:indexer.class.php

示例13: array

  function fetch_back_links_node_ids($target_node_id, $groups_ids = array())
  {
    $links = $this->fetch_back_links($target_node_id, $groups_ids);

    return complex_array :: get_column_values('linker_node_id', $links);
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:6,代码来源:links_manager.class.php


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