1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
bypersontype.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sale\Delivery\Restrictions;
4
5
use Bitrix\Sale\Internals\CollectableEntity;
6
use Bitrix\Sale\Internals\Entity;
7
use Bitrix\Sale\Internals\PersonTypeTable;
8
use Bitrix\Sale\ShipmentCollection;
9
use Bitrix\Main\Localization\Loc;
10
use Bitrix\Sale\Order;
11
12
Loc::loadMessages(__FILE__);
13
14
class
ByPersonType
extends
Base
15
{
22
public
static
function
check
($personTypeId,
array
$params
, $deliveryId = 0)
23
{
24
if
(is_array(
$params
) && isset(
$params
[
'PERSON_TYPE_ID'
]))
25
{
26
return
in_array($personTypeId,
$params
[
'PERSON_TYPE_ID'
]);
27
}
28
29
return
true
;
30
}
31
36
public
static
function
extractParams(
Entity
$entity
)
37
{
38
if
(
$entity
instanceof
CollectableEntity
)
39
{
41
$collection =
$entity
->getCollection();
42
44
$order
= $collection->getOrder();
45
}
46
elseif
(
$entity
instanceof Order)
47
{
49
$order
=
$entity
;
50
}
51
52
if
(!
$order
)
53
return
false
;
54
55
$personTypeId =
$order
->getPersonTypeId();
56
return
$personTypeId;
57
}
58
62
public
static
function
getClassTitle
()
63
{
64
return
Loc::getMessage(
'SALE_DLVR_RSTR_BY_PERSON_TYPE'
);
65
}
66
70
public
static
function
getClassDescription
()
71
{
72
return
Loc::getMessage(
'SALE_DLVR_RSTR_BY_PERSON_TYPE_DESC'
);
73
}
74
79
public
static
function
getParamsStructure
($deliveryId = 0)
80
{
81
$personTypeList =
array
();
82
83
$dbRes
=
\Bitrix\Sale\PersonType::getList
();
84
85
while
($personType =
$dbRes
->fetch())
86
$personTypeList[$personType[
"ID"
]] = $personType[
"NAME"
].
" ("
.$personType[
"ID"
].
")"
;
87
88
return
array
(
89
"PERSON_TYPE_ID"
=>
array
(
90
"TYPE"
=>
"ENUM"
,
91
'MULTIPLE'
=>
'Y'
,
92
"LABEL"
=> Loc::getMessage(
"SALE_DLVR_RSTR_BY_PERSON_TYPE_NAME"
),
93
"OPTIONS"
=> $personTypeList
94
)
95
);
96
}
97
102
public
static
function
getSeverity
($mode)
103
{
104
return
Manager::SEVERITY_STRICT
;
105
}
106
}
Bitrix\Sale\Delivery\Restrictions\ByPersonType
Определения
bypersontype.php:15
Bitrix\Sale\Delivery\Restrictions\ByPersonType\check
static check($personTypeId, array $params, $deliveryId=0)
Определения
bypersontype.php:22
Bitrix\Sale\Delivery\Restrictions\ByPersonType\getParamsStructure
static getParamsStructure($deliveryId=0)
Определения
bypersontype.php:79
Bitrix\Sale\Delivery\Restrictions\ByPersonType\getClassTitle
static getClassTitle()
Определения
bypersontype.php:62
Bitrix\Sale\Delivery\Restrictions\ByPersonType\getClassDescription
static getClassDescription()
Определения
bypersontype.php:70
Bitrix\Sale\Delivery\Restrictions\ByPersonType\getSeverity
static getSeverity($mode)
Определения
bypersontype.php:102
Bitrix\Sale\Internals\CollectableEntity
Определения
collectableentity.php:14
Bitrix\Sale\PersonType\getList
static getList(array $parameters=[])
Определения
persontype.php:100
Bitrix\Sale\Services\Base\RestrictionManager\SEVERITY_STRICT
const SEVERITY_STRICT
Определения
restrictionmanager.php:31
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$entity
$entity
Определения
group_bizproc_workflow_delete.php:17
Bitrix\Main\Entity
Определения
ufield.php:9
Bitrix\Sale\Services\Base
Определения
concreteproductrestriction.php:3
$order
$order
Определения
payment.php:8
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
$dbRes
$dbRes
Определения
yandex_detail.php:168
bitrix
modules
sale
lib
delivery
restrictions
bypersontype.php
Создано системой
1.14.0