• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/tree.php
  • Класс: BitrixSaleLocationis
  • Вызов: is::checkNodeIsParentOfNodeByCondition
static function checkNodeIsParentOfNodeByCondition($parentNodeFilter, $nodeFilter, $behaviour = array('CHECK_DIRECT' => false))
{
	$parent = static::getList(array('filter' => $parentNodeFilter, 'limit' => 1))->fetch();
	$child = static::getList(array('filter' => $nodeFilter, 'limit' => 1))->fetch();

	if(!intval($parent['ID']))
			throw new MainSystemException('Node being checked not found');
	if(!intval($child['ID']))
			throw new MainSystemException('Child node not found');

	if($behaviour['CHECK_DIRECT'])
		return $parent['ID'] == $child['PARENT_ID'];

	return $parent['LEFT_MARGIN'] < $child['LEFT_MARGIN'] && $parent['RIGHT_MARGIN'] > $child['RIGHT_MARGIN'];
}