Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
propertyrelation.php
1
<?php
2
3
4
namespace
Bitrix\Sale\Rest\View
;
5
6
7
use
Bitrix\Main\Result
;
8
use
Bitrix\Rest\Integration\View\Attributes
;
9
use
Bitrix\Rest\Integration\View\DataType
;
10
use
Bitrix\Rest\Integration\View\Base
;
11
12
class
PropertyRelation
extends
Base
13
{
14
public
function
getFields
()
15
{
16
return
[
17
'PROPERTY_ID'
=>[
18
'TYPE'
=>DataType::TYPE_INT,
19
'ATTRIBUTES'
=>[
20
Attributes::REQUIRED,
21
Attributes::IMMUTABLE
22
]
23
],
24
'ENTITY_ID'
=>[
25
'TYPE'
=>DataType::TYPE_INT,
26
'ATTRIBUTES'
=>[
27
Attributes::REQUIRED,
28
Attributes::IMMUTABLE
29
]
30
],
31
'ENTITY_TYPE'
=>[
32
'TYPE'
=>DataType::TYPE_STRING,
33
'ATTRIBUTES'
=>[
34
Attributes::REQUIRED,
35
Attributes::IMMUTABLE
36
]
37
]
38
];
39
}
40
41
public
function
convertKeysToSnakeCaseArguments
($name, $arguments)
42
{
43
if
($name ==
'deletebyfilter'
)
44
{
45
if
(isset($arguments[
'fields'
]))
46
{
47
$fields = $arguments[
'fields'
];
48
if
(!empty($fields))
49
$arguments[
'fields'
] = $this->
convertKeysToSnakeCaseFields
($fields);
50
}
51
}
52
else
53
{
54
$arguments = parent::convertKeysToSnakeCaseArguments($name, $arguments);
55
}
56
57
return
$arguments;
58
}
59
60
public
function
checkArguments
($name, $arguments):
Result
61
{
62
if
($name ==
'deletebyfilter'
)
63
{
64
$r = $this->
checkFieldsAdd
($arguments[
'fields'
]);
65
}
66
else
67
{
68
$r = parent::checkArguments($name, $arguments);
69
}
70
71
return
$r;
72
}
73
74
public
function
internalizeArguments
($name, $arguments): array
75
{
76
if
($name ==
'deletebyfilter'
)
77
{
78
$fields = $arguments[
'fields'
];
79
if
(!empty($fields))
80
$arguments[
'fields'
] = $this->
internalizeFieldsAdd
($fields);
81
}
82
else
83
{
84
parent::internalizeArguments($name, $arguments);
85
}
86
87
return
$arguments;
88
}
89
}
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\Rest\Integration\View\Attributes
Definition
attributes.php:8
Bitrix\Rest\Integration\View\Base
Definition
base.php:16
Bitrix\Rest\Integration\View\Base\internalizeFieldsAdd
internalizeFieldsAdd($fields, $fieldsInfo=[])
Definition
base.php:153
Bitrix\Rest\Integration\View\Base\checkFieldsAdd
checkFieldsAdd($fields)
Definition
base.php:717
Bitrix\Rest\Integration\View\Base\convertKeysToSnakeCaseFields
convertKeysToSnakeCaseFields($fields)
Definition
base.php:87
Bitrix\Rest\Integration\View\DataType
Definition
datatype.php:11
Bitrix\Sale\Controller\PropertyRelation
Definition
propertyrelation.php:14
Bitrix\Sale\Rest\View\PropertyRelation\internalizeArguments
internalizeArguments($name, $arguments)
Definition
propertyrelation.php:74
Bitrix\Sale\Rest\View\PropertyRelation\convertKeysToSnakeCaseArguments
convertKeysToSnakeCaseArguments($name, $arguments)
Definition
propertyrelation.php:41
Bitrix\Sale\Rest\View\PropertyRelation\checkArguments
checkArguments($name, $arguments)
Definition
propertyrelation.php:60
Bitrix\Sale\Rest\View\PropertyRelation\getFields
getFields()
Definition
propertyrelation.php:14
Bitrix\Sale\Rest\View
Definition
base.php:3
modules
sale
lib
rest
view
propertyrelation.php
Создано системой
1.10.0