Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
mapresult.php
1
<?
2
namespace
Bitrix\Sale\Location\Comparator
;
3
4
use
Bitrix\Sale\Location\LocationTable
;
5
11
class
MapResult
12
{
13
protected
$lastProcessedId
= 0;
14
protected
$supportedCount
= 0;
15
16
protected
$mapped
= array();
17
protected
$notFound
= array();
18
protected
$duplicated
= array();
19
20
public
function
setSupportedCount
($count) { $this->supportedCount = intval($count); }
21
public
function
setLastProcessedId
($id) { $this->lastProcessedId = intval($id); }
22
public
function
getLastProcessedId
() {
return
$this->lastProcessedId
; }
23
public
function
getSupportedCount
() {
return
$this->supportedCount
; }
24
public
function
getDuplicated
() {
return
$this->duplicated
; }
25
public
function
getNotFound
() {
return
$this->notFound
; }
26
public
function
getMapped
() {
return
$this->mapped
; }
27
28
public
function
addNotFound
($eLocId, $eLocName)
29
{
30
$this->notFound[] = array($eLocId, $eLocName);
31
}
32
33
public
function
addDuplicated
($eLocId, $eLocName, $bLocId)
34
{
35
$this->duplicated[] = array($eLocId, $eLocName, $bLocId);
36
}
37
38
public
function
addMapped
($eLocId, $eLocName, $bLocId)
39
{
40
$this->mapped[] = array($eLocId, $eLocName, $bLocId, $this->
getLocationChain
($bLocId));
41
}
42
43
protected
function
getLocationChain
($locationId)
44
{
45
$res = LocationTable::getList(array(
46
'filter'
=> array(
47
array(
48
'LOGIC'
=>
'OR'
,
49
'=CODE'
=> $locationId,
50
'=ID'
=> $locationId
51
),
52
),
53
'select'
=> array(
54
'ID'
,
'CODE'
,
'LEFT_MARGIN'
,
'RIGHT_MARGIN'
55
)
56
));
57
58
if
(!$loc = $res->fetch())
59
return
''
;
60
61
$result =
''
;
62
$res = LocationTable::getList(array(
63
'filter'
=> array(
64
'<=LEFT_MARGIN'
=> $loc[
'LEFT_MARGIN'
],
65
'>=RIGHT_MARGIN'
=> $loc[
'RIGHT_MARGIN'
],
66
'NAME.LANGUAGE_ID'
=>
'ru'
67
),
68
'select'
=> array(
69
'ID'
,
'CODE'
,
70
'LOC_NAME'
=>
'NAME.NAME'
71
),
72
'order'
=> array(
'LEFT_MARGIN'
=>
'ASC'
)
73
));
74
75
while
($loc = $res->fetch())
76
$result .= $loc[
'LOC_NAME'
].
', '
;
77
78
return
$result;
79
}
80
}
Bitrix\Sale\Location\Comparator\MapResult
Definition
mapresult.php:12
Bitrix\Sale\Location\Comparator\MapResult\$duplicated
$duplicated
Definition
mapresult.php:18
Bitrix\Sale\Location\Comparator\MapResult\addNotFound
addNotFound($eLocId, $eLocName)
Definition
mapresult.php:28
Bitrix\Sale\Location\Comparator\MapResult\$mapped
$mapped
Definition
mapresult.php:16
Bitrix\Sale\Location\Comparator\MapResult\getDuplicated
getDuplicated()
Definition
mapresult.php:24
Bitrix\Sale\Location\Comparator\MapResult\setSupportedCount
setSupportedCount($count)
Definition
mapresult.php:20
Bitrix\Sale\Location\Comparator\MapResult\setLastProcessedId
setLastProcessedId($id)
Definition
mapresult.php:21
Bitrix\Sale\Location\Comparator\MapResult\getLastProcessedId
getLastProcessedId()
Definition
mapresult.php:22
Bitrix\Sale\Location\Comparator\MapResult\getMapped
getMapped()
Definition
mapresult.php:26
Bitrix\Sale\Location\Comparator\MapResult\$lastProcessedId
$lastProcessedId
Definition
mapresult.php:13
Bitrix\Sale\Location\Comparator\MapResult\$supportedCount
$supportedCount
Definition
mapresult.php:14
Bitrix\Sale\Location\Comparator\MapResult\getLocationChain
getLocationChain($locationId)
Definition
mapresult.php:43
Bitrix\Sale\Location\Comparator\MapResult\addDuplicated
addDuplicated($eLocId, $eLocName, $bLocId)
Definition
mapresult.php:33
Bitrix\Sale\Location\Comparator\MapResult\getSupportedCount
getSupportedCount()
Definition
mapresult.php:23
Bitrix\Sale\Location\Comparator\MapResult\$notFound
$notFound
Definition
mapresult.php:17
Bitrix\Sale\Location\Comparator\MapResult\getNotFound
getNotFound()
Definition
mapresult.php:25
Bitrix\Sale\Location\Comparator\MapResult\addMapped
addMapped($eLocId, $eLocName, $bLocId)
Definition
mapresult.php:38
Bitrix\Sale\Location\LocationTable
Definition
location.php:39
Bitrix\Sale\Location\Comparator
Definition
mapper.php:2
modules
sale
lib
location
comparator
mapresult.php
Создано системой
1.10.0