403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/sale/lib/location/comparator/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/ilovecveti.ru/bitrix/modules/sale/lib/location/comparator/mapresult.php
<?
namespace Bitrix\Sale\Location\Comparator;

use Bitrix\Sale\Location\LocationTable;

/**
 * Class MapResult
 * @package Bitrix\Sale\Location\Comparator
 */

class MapResult
{
	protected $lastProcessedId = 0;
	protected $supportedCount = 0;

	protected $mapped = array();
	protected $notFound = array();
	protected $duplicated = array();

	public function setSupportedCount($count)	{ $this->supportedCount = intval($count); }
	public function setLastProcessedId($id)		{ $this->lastProcessedId = intval($id); }
	public function getLastProcessedId()		{ return $this->lastProcessedId; }
	public function getSupportedCount()			{ return $this->supportedCount; }
	public function getDuplicated() 			{ return $this->duplicated; }
	public function getNotFound() 				{ return $this->notFound; }
	public function getMapped() 				{ return $this->mapped; }

	public function addNotFound($eLocId, $eLocName)
	{
		$this->notFound[] = array($eLocId, $eLocName);
	}

	public function addDuplicated($eLocId, $eLocName, $bLocId)
	{
		$this->duplicated[] = array($eLocId, $eLocName, $bLocId);
	}

	public function addMapped($eLocId, $eLocName, $bLocId)
	{
		$this->mapped[] = array($eLocId, $eLocName, $bLocId, $this->getLocationChain($bLocId));
	}

	protected function getLocationChain($locationId)
	{
		$res = LocationTable::getList(array(
			'filter' => array(
				array(
					'LOGIC' => 'OR',
					'=CODE' => $locationId,
					'=ID' => $locationId
				),
			),
			'select' => array(
				'ID', 'CODE', 'LEFT_MARGIN', 'RIGHT_MARGIN'
			)
		));

		if(!$loc = $res->fetch())
			return '';
	
		$result = '';
		$res = LocationTable::getList(array(
			'filter' => array(
				'<=LEFT_MARGIN' => $loc['LEFT_MARGIN'],
				'>=RIGHT_MARGIN' => $loc['RIGHT_MARGIN'],
				'NAME.LANGUAGE_ID' => 'ru'
			),
			'select' => array(
				'ID', 'CODE',
				'LOC_NAME' => 'NAME.NAME'
			),
			'order' => array('LEFT_MARGIN' => 'ASC')
		));

		while($loc = $res->fetch())
			$result .= $loc['LOC_NAME'].', ';

		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit