1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Element.php
См. документацию.
1
<?php
8
9
namespace
Bitrix\Iblock\Controller;
10
11
use Bitrix\Iblock\IblockTable;
12
use Bitrix\Main\Application;
13
use Bitrix\Main\DI\ServiceLocator;
14
use Bitrix\Main\Engine\Contract\FallbackActionInterface;
15
use Bitrix\Main\Engine\Controller;
16
24
final
class
Element
extends
Controller
implements
FallbackActionInterface
25
{
26
protected
$iblock
;
27
28
protected
function
getDefaultPreFilters
()
29
{
30
return
[];
31
}
32
42
public
function
fallbackAction
($actionName)
43
{
44
$this->setSourceParametersList(array_merge(
45
$this->getSourceParametersList(), [[
'iblock'
=> $this->
getIblock
()]]
46
));
47
48
return
$this->forward($this->
getController
(), $actionName);
49
}
50
55
protected
function
getController
()
56
{
57
$iblock
= $this->
getIblock
();
58
59
$controller = DefaultElement::class;
60
61
if
(
$iblock
)
62
{
63
$serviceLocator = ServiceLocator::getInstance();
64
$serviceId =
"iblock.element.{$iblock->getApiCode()}.rest.controller"
;
65
66
if
($serviceLocator->has($serviceId))
67
{
68
// get from service locator
69
$controller = $serviceLocator->get($serviceId);
70
}
71
}
72
73
return
$controller;
74
}
75
76
protected
function
getIblock
()
77
{
78
if
($this->iblock ===
null
)
79
{
80
$iblockId
= Application::getInstance()->getContext()->getRequest()->get(
'iblockId'
);
81
82
$this->iblock =
IblockTable::getByPrimary
(
$iblockId
, [
83
'select'
=> [
'ID'
,
'API_CODE'
]
84
])->fetchObject();
85
}
86
87
return
$this->iblock
;
88
}
89
}
Bitrix\Iblock\Controller\Element
Определения
Element.php:25
Bitrix\Iblock\Controller\Element\getIblock
getIblock()
Определения
Element.php:76
Bitrix\Iblock\Controller\Element\$iblock
$iblock
Определения
Element.php:26
Bitrix\Iblock\Controller\Element\getDefaultPreFilters
getDefaultPreFilters()
Определения
Element.php:28
Bitrix\Iblock\Controller\Element\fallbackAction
fallbackAction($actionName)
Определения
Element.php:42
Bitrix\Iblock\Controller\Element\getController
getController()
Определения
Element.php:55
Bitrix\Main\ORM\Data\DataManager\getByPrimary
static getByPrimary($primary, array $parameters=array())
Определения
datamanager.php:330
$iblockId
$iblockId
Определения
iblock_catalog_edit.php:30
Bitrix\Main\Engine\Contract\FallbackActionInterface
Определения
fallbackactioninterface.php:8
Bitrix\Main\Controller
Определения
agreement.php:2
bitrix
modules
iblock
lib
Controller
Element.php
Создано системой
1.14.0