1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
viewed.php
См. документацию.
1
<?php
2
namespace
Bitrix\Catalog\Product;
3
4
use Bitrix\Main,
5
Bitrix\Iblock,
6
Bitrix\Catalog;
7
14
class
Viewed
15
{
24
public
static
function
getParentSection
($sectionId, $depth)
25
{
26
$sectionId = (int)$sectionId;
27
$depth = (int)$depth;
28
if
($sectionId <= 0 || $depth <= 0)
29
return
null
;
30
$section =
Iblock\SectionTable::getList
(
array
(
31
'select'
=>
array
(
'ID'
,
'IBLOCK_ID'
,
'LEFT_MARGIN'
,
'RIGHT_MARGIN'
,
'DEPTH_LEVEL'
),
32
'filter'
=>
array
(
'=ID'
=> $sectionId)
33
))->fetch();
34
if
(empty($section))
35
return
null
;
36
$section[
'DEPTH_LEVEL'
] = (int)$section[
'DEPTH_LEVEL'
];
37
if
($section[
'DEPTH_LEVEL'
] < $depth)
38
return
null
;
39
if
($section[
'DEPTH_LEVEL'
] == $depth)
40
return
(
int
)$section[
'ID'
];
41
42
$parentSection =
Iblock\SectionTable::getList
(
array
(
43
'select'
=>
array
(
'ID'
),
44
'filter'
=>
array
(
45
'=IBLOCK_ID'
=> $section[
'IBLOCK_ID'
],
46
'<=LEFT_MARGIN'
=> $section[
'LEFT_MARGIN'
],
47
'>=RIGHT_MARGIN'
=> $section[
'RIGHT_MARGIN'
],
48
'=DEPTH_LEVEL'
=> $depth
49
)
50
))->fetch();
51
if
(!empty($parentSection))
52
return
(
int
)$parentSection[
'ID'
];
53
54
return
null
;
55
}
56
}
Bitrix\Catalog\Product\Viewed
Определения
viewed.php:15
Bitrix\Catalog\Product\Viewed\getParentSection
static getParentSection($sectionId, $depth)
Определения
viewed.php:24
Bitrix\Main\ORM\Data\DataManager\getList
static getList(array $parameters=array())
Определения
datamanager.php:431
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
bitrix
modules
catalog
lib
product
viewed.php
Создано системой
1.14.0