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


PHP LocationTable::getPathToNodeByCondition方法代码示例

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


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

示例1: getLocationStringByCondition

 protected static function getLocationStringByCondition($condition, $behaviour = array('INVERSE' => false, 'DELIMITER' => ', ', 'LANGUAGE_ID' => LANGUAGE_ID))
 {
     if (isset($behaviour) && !is_array($behaviour)) {
         $behaviour = array();
     }
     if (!isset($behaviour['DELIMITER'])) {
         $behaviour['DELIMITER'] = ', ';
     }
     if (!isset($behaviour['LANGUAGE_ID'])) {
         $behaviour['LANGUAGE_ID'] = LANGUAGE_ID;
     }
     try {
         $res = Location\LocationTable::getPathToNodeByCondition($condition, array('select' => array('LNAME' => 'NAME.NAME'), 'filter' => array('=NAME.LANGUAGE_ID' => $behaviour['LANGUAGE_ID'])));
         $path = array();
         while ($item = $res->fetch()) {
             $path[] = $item['LNAME'];
         }
         if ($behaviour['INVERSE']) {
             $path = array_reverse($path);
         }
         return implode($behaviour['DELIMITER'], $path);
     } catch (\Bitrix\Main\SystemException $e) {
         return '';
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:25,代码来源:locationhelper.php

示例2: obtainDataTreeTrunk

	protected function obtainDataTreeTrunk(&$cachedData)
	{
		// check for static tree
		$forkItemFilter = false;

		$res = Location\LocationTable::getList(array(
			'group' => array('DEPTH_LEVEL'),
			'select' => array('DEPTH_LEVEL', 'CNT'),
			'order' => array('DEPTH_LEVEL' => 'asc')
		));
		$forkAtLevel = 0;
		while($item = $res->fetch())
		{
			if($item['CNT'] < 2)
				$forkAtLevel = $item['DEPTH_LEVEL'];
			else
				break;
		}

		if($forkAtLevel > 0)
			$forkItemFilter = array('DEPTH_LEVEL' => $forkAtLevel);

		// check for tree filtered by site

		if($this->filterBySite && is_array($cachedData['TEMP']['CONNECTORS']) && !empty($cachedData['TEMP']['CONNECTORS']))
		{
			$dcp = Location\LocationTable::getDeepestCommonParent($cachedData['TEMP']['CONNECTORS'], array('select' => array('ID')))->fetch();

			if(is_array($dcp) && intval($dcp['ID']))
				$forkItemFilter = array('ID' => intval($dcp['ID']));
		}

		$cachedData['TREE_TRUNK'] = array();
		if(is_array($forkItemFilter) && !empty($forkItemFilter)) // get fork item id
		{
			$res = Location\LocationTable::getPathToNodeByCondition($forkItemFilter, array(
				'select' => array_merge($this->getNodeSelectFields(), array('LNAME' => 'NAME.NAME')),
				'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID)
			));
			$res->addReplacedAliases(array('LNAME' => 'NAME'));
			while($item = $res->fetch())
			{
				$cachedData['TREE_TRUNK'][] = $item;
			}
		}
	}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:46,代码来源:class.php


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