• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fetch_by_node_ids函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fetch_by_node_ids函数的典型用法代码示例。如果您正苦于以下问题:PHP fetch_by_node_ids函数的具体用法?PHP fetch_by_node_ids怎么用?PHP fetch_by_node_ids使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: get_dataset

	function & get_dataset(& $counter, $params = array())
	{
		$mime_type = new mime_type();

		$pricelists_array =& $this->_fetch($counter, $params);
				
		$file_ids = array();
		foreach($pricelists_array as $id => $data)
			if($data['file_id'] > 0)
				$file_ids[$data['file_id']] = $data['file_id'];
		
		if(!$file_ids)
			return new array_dataset($pricelists_array);

		$files_counter = null;
		$file_data = fetch_by_node_ids($file_ids, 'file_object', $files_counter);

		foreach($pricelists_array as $id => $data)
			if($data['file_id'] > 0)
			{
				$pricelists_array[$id]['file_size'] = $file_data[$data['file_id']]['size'];
				$pricelists_array[$id]['file_icon'] = $mime_type->get_type_icon($file_data[$data['file_id']]['mime_type']);
			}
		
		
		return new array_dataset($pricelists_array);
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:27,代码来源:pricelist_datasource.class.php


示例2: get_dataset

	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: _valid_perform

 function _valid_perform(&$request, &$response)
 {
     if (!($objects_amounts = $this->dataspace->get('amount'))) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         if ($request->has_attribute('popup')) {
             $response->write(close_popup_response($request));
         }
         return;
     }
     $objects_data =& fetch_by_node_ids(array_keys($objects_amounts), $this->_define_catalog_object(), $counter);
     if (!$objects_data) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         if ($request->has_attribute('popup')) {
             $response->write(close_popup_response($request));
         }
         return;
     }
     $object =& site_object_factory::create($this->_define_catalog_object());
     if (!method_exists($object, 'get_cart_item')) {
         $request->set_status(REQUEST_STATUS_FAILURE);
         if ($request->has_attribute('popup')) {
             $response->write(close_popup_response($request));
         }
         return;
     }
     $cart =& cart::instance();
     foreach ($objects_data as $key => $object_data) {
         $object->import_attributes($object_data);
         $cart_item =& $object->get_cart_item();
         $cart_item->set_amount($objects_amounts[$key]);
         $cart->add_item($cart_item);
     }
     $response->redirect('/root/cart?popup=1');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:34,代码来源:add_cart_items_action.class.php


示例4: _get_objects_to_delete

	function _get_objects_to_delete($node_ids)
	{
		$params = array(
			'restrict_by_class' => false
		);
		
		$objects =& fetch_by_node_ids($node_ids, 'site_object', $counter, $params);
		
		$result = array();
		$tree = tree :: instance();
		
		foreach($objects as $id => $item)
		{
			if (!isset($item['actions']['delete']))
			{
				$objects[$id]['delete_status'] = 1;
				$objects[$id]['delete_reason'] = strings :: get('delete_action_not_accessible', 'error');
				continue;
			}
			
			$site_object =& wrap_with_site_object($item);
			if (!$site_object->can_delete())
			{
				$objects[$id]['delete_status'] = 1;
				$objects[$id]['delete_reason'] = strings :: get('cant_be_deleted', 'error');
				continue;
			}	
			
			$objects[$id]['delete_reason'] = strings :: get('ok');
			$objects[$id]['delete_status'] = 0;
			$objects[$id]['ids'][$item['node_id']] = 1;
		}
		
		return $objects;
	}
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:35,代码来源:multi_delete_action.class.php


示例5: _get_objects

  function _get_objects($node_ids)
  {
    $params = array(
      'restrict_by_class' => false
    );

    $objects =& fetch_by_node_ids($node_ids, 'site_object', $counter, $params);
    return $objects;
  }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:9,代码来源:multi_toggle_publish_status_action.class.php


示例6: _valid_perform

 function _valid_perform()
 {
     if (!($objects_amounts = $this->dataspace->get('amount'))) {
         return new close_popup_response(RESPONSE_STATUS_FAILURE);
     }
     $objects_data =& fetch_by_node_ids(array_keys($objects_amounts), $this->_catalog_object_class_name, $counter);
     if (!$objects_data) {
         return new close_popup_response(RESPONSE_STATUS_FAILURE);
     }
     $object =& site_object_factory::create($this->_catalog_object_class_name);
     if (!method_exists($object, 'get_cart_item')) {
         return new close_popup_response(RESPONSE_STATUS_FAILURE);
     }
     $cart =& cart::instance();
     foreach ($objects_data as $key => $object_data) {
         $object->import_attributes($object_data);
         $cart_item =& $object->get_cart_item();
         $cart_item->set_amount($objects_amounts[$key]);
         $cart->add_item($cart_item);
     }
     return new redirect_response(RESPONSE_STATUS_SUCCESS, '/root/cart?popup=1');
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:22,代码来源:add_cart_items_action.class.php


示例7: _get_objects_to_move

  function _get_objects_to_move($node_ids)
  {
    $params = array(
      'restrict_by_class' => false
    );

    $objects = fetch_by_node_ids($node_ids, 'site_object', $counter, $params);

    foreach($objects as $id => $item)
    {
      $objects[$id]['ids'][$item['node_id']] = 1;
    }

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fetch_category_title函数代码示例发布时间:2022-05-15
下一篇:
PHP fetch_bbarray_cookie函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap