Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
iblocktype.php
1
<?
2
namespace
Bitrix\Lists\Entity
;
3
4
use
Bitrix\Lists\Service\Param
;
5
use
Bitrix\Main\Errorable
;
6
use
Bitrix\Main\ErrorableImplementation
;
7
use
Bitrix\Main\ErrorCollection
;
8
9
class
IblockType
implements
Errorable
10
{
11
use
ErrorableImplementation
;
12
13
private
$param;
14
private
$params = [];
15
16
public
function
__construct
(
Param
$param)
17
{
18
$this->param = $param;
19
$this->params = $param->
getParams
();
20
21
$this->errorCollection =
new
ErrorCollection
;
22
}
23
29
public
function
getIblockTypeId
()
30
{
31
$this->param->checkRequiredInputParams([
"IBLOCK_CODE"
,
"IBLOCK_ID"
]);
32
if
($this->param->hasErrors())
33
{
34
$this->errorCollection->add($this->param->getErrors());
35
return
null
;
36
}
37
38
$filter = [
"CHECK_PERMISSIONS"
=>
"Y"
];
39
40
if
(empty($this->params[
"IBLOCK_ID"
]))
41
{
42
$filter[
"=CODE"
] = $this->params[
"IBLOCK_CODE"
];
43
}
44
if
(empty($this->params[
"IBLOCK_CODE"
]))
45
{
46
$filter[
"=ID"
] = $this->params[
"IBLOCK_ID"
];
47
}
48
49
$queryObject = \CIBlock::getList([], $filter);
50
if
($iblock = $queryObject->fetch())
51
{
52
return
($iblock[
"IBLOCK_TYPE_ID"
] ? $iblock[
"IBLOCK_TYPE_ID"
] :
null
);
53
}
54
else
55
{
56
return
null
;
57
}
58
}
59
}
Bitrix\Lists\Entity\IblockType
Definition
iblocktype.php:10
Bitrix\Lists\Entity\IblockType\getIblockTypeId
getIblockTypeId()
Definition
iblocktype.php:29
Bitrix\Lists\Entity\IblockType\__construct
__construct(Param $param)
Definition
iblocktype.php:16
Bitrix\Lists\Service\Param
Definition
param.php:10
Bitrix\Lists\Service\Param\getParams
getParams()
Definition
param.php:70
Bitrix\Main\ErrorCollection
Definition
errorcollection.php:14
Bitrix\Main\Errorable
Definition
errorable.php:6
Bitrix\Lists\Entity
Definition
controllable.php:2
Bitrix\Main\ErrorableImplementation
trait ErrorableImplementation
Definition
errorableimplementation.php:8
modules
lists
lib
entity
iblocktype.php
Создано системой
1.10.0