Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
sender.php
1
<?php
2
namespace
Bitrix\Sale\Exchange\Integration\Rest
;
3
4
use
Bitrix\Main\Error
;
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Sale\Exchange\Integration
;
7
8
Loc::loadMessages
(__FILE__);
9
10
class
Sender
11
{
12
protected
$fields
;
13
14
public
function
__construct
()
15
{
16
$this->fields = new \Bitrix\Sale\Internals\Fields(
17
\
Bitrix
\Main\
Context::getCurrent
()->getRequest()->toArray());
18
}
19
23
protected
function
getFields
()
24
{
25
return
$this->fields
;
26
}
27
28
public
function
getField
($name)
29
{
30
return
isset($this->fields[$name]) ? $this->fields[$name]:
''
;
31
}
32
33
public
function
checkFields
()
34
{
35
$r = new \Bitrix\Sale\Result();
36
37
if
(empty($this->
getField
(
'orderIds'
)))
38
{
39
$r->addError(
new
Error
(
Loc::getMessage
(
'SALE_ORDER_REQUEST_ORDER_IDS_EMPTY'
))) ;
40
}
41
42
if
(empty($this->
getField
(
'entityId'
)))
43
{
44
$r->addError(
new
Error
(
Loc::getMessage
(
'SALE_ORDER_REQUEST_ENTITY_ID_EMPTY'
))) ;
45
}
46
47
if
(empty($this->
getField
(
'entityTypeId'
)))
48
{
49
$r->addError(
new
Error
(
Loc::getMessage
(
'SALE_ORDER_REQUEST_ENTITY_TYPE_ID_EMPTY'
)));
50
}
51
elseif(Integration\CRM\
EntityType::isDefined
($this->
getField
(
'entityTypeId'
)) ==
false
)
52
{
53
$r->addError(
new
Error
(
Loc::getMessage
(
'SALE_ORDER_REQUEST_ENTITY_TYPE_ID_UNKNOW'
))) ;
54
}
55
56
return
$r;
57
}
58
}
Bitrix\Main\Context\getCurrent
static getCurrent()
Definition
context.php:241
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sale\Exchange\EntityType\isDefined
static isDefined($typeID)
Definition
entitytype.php:46
Bitrix\Sale\Exchange\Integration\Rest\Sender
Definition
sender.php:11
Bitrix\Sale\Exchange\Integration\Rest\Sender\__construct
__construct()
Definition
sender.php:14
Bitrix\Sale\Exchange\Integration\Rest\Sender\checkFields
checkFields()
Definition
sender.php:33
Bitrix\Sale\Exchange\Integration\Rest\Sender\$fields
$fields
Definition
sender.php:12
Bitrix\Sale\Exchange\Integration\Rest\Sender\getField
getField($name)
Definition
sender.php:28
Bitrix\Sale\Exchange\Integration\Rest\Sender\getFields
getFields()
Definition
sender.php:23
Bitrix\Sale\Exchange\Integration\Rest
Bitrix\Sale\Exchange\Integration
Bitrix
modules
sale
lib
exchange
integration
rest
sender.php
Создано системой
1.10.0