1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
persontype.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sale\Services\PaySystem\Restrictions;
4
5
use Bitrix\Main\Error;
6
use Bitrix\Main\Localization\Loc;
7
use Bitrix\Main\Result;
8
use Bitrix\Sale\Internals\CollectableEntity;
9
use Bitrix\Sale\Internals\Entity;
10
use Bitrix\Sale\Order;
11
use Bitrix\Sale\PaymentCollection;
12
use Bitrix\Sale\PaySystem\ClientType;
13
use Bitrix\Sale\PaySystem\Service;
14
use Bitrix\Sale\Registry;
15
use Bitrix\Sale\Services\Base;
16
17
Loc::loadMessages(__FILE__);
18
19
class
PersonType
extends
Base\Restriction
20
{
27
public
static
function
check
(
$params
,
array
$restrictionParams, $serviceId = 0)
28
{
29
if
(is_array($restrictionParams) && isset($restrictionParams[
'PERSON_TYPE_ID'
]))
30
{
31
return
in_array(
$params
, $restrictionParams[
'PERSON_TYPE_ID'
]);
32
}
33
34
return
true
;
35
}
36
41
public
static
function
extractParams(
Entity
$entity
)
42
{
43
if
(
$entity
instanceof
CollectableEntity
)
44
{
46
$collection =
$entity
->getCollection();
47
49
$order
= $collection->getOrder();
50
}
51
elseif
(
$entity
instanceof Order)
52
{
53
$order
=
$entity
;
54
}
55
56
if
(!
$order
)
57
return
false
;
58
59
$personTypeId =
$order
->getPersonTypeId();
60
return
$personTypeId;
61
}
62
66
public
static
function
getClassTitle
()
67
{
68
return
Loc::getMessage(
'SALE_PS_RESTRICTIONS_BY_PERSON_TYPE'
);
69
}
70
74
public
static
function
getClassDescription
()
75
{
76
return
Loc::getMessage(
'SALE_PS_RESTRICTIONS_BY_PERSON_TYPE_DESC'
);
77
}
78
79
public
static
function
getOnApplyErrorMessage
(): string
80
{
81
return
Loc::getMessage(
'SALE_PS_RESTRICTIONS_BY_PERSON_TYPE_ON_APPLY_ERROR_MSG'
);
82
}
83
89
public
static
function
getParamsStructure
(
$entityId
= 0)
90
{
91
$personTypeList =
array
();
92
93
$dbRes
=
\Bitrix\Sale\PersonType::getList
();
94
95
while
($personType =
$dbRes
->fetch())
96
$personTypeList[$personType[
"ID"
]] = $personType[
"NAME"
].
" ("
.$personType[
"ID"
].
")"
;
97
98
return
array
(
99
"PERSON_TYPE_ID"
=>
array
(
100
"TYPE"
=>
"ENUM"
,
101
'MULTIPLE'
=>
'Y'
,
102
"LABEL"
=> Loc::getMessage(
"SALE_SALE_PS_RESTRICTIONS_BY_PERSON_TYPE_NAME"
),
103
"OPTIONS"
=> $personTypeList
104
)
105
);
106
}
107
112
public
static
function
getSeverity
($mode)
113
{
114
return
Manager::SEVERITY_STRICT
;
115
}
116
}
Bitrix\Sale\Internals\CollectableEntity
Определения
collectableentity.php:14
Bitrix\Sale\PersonType
Определения
persontype.php:17
Bitrix\Sale\PersonType\getList
static getList(array $parameters=[])
Определения
persontype.php:100
Bitrix\Sale\Services\Base\RestrictionManager\SEVERITY_STRICT
const SEVERITY_STRICT
Определения
restrictionmanager.php:31
Bitrix\Sale\Services\PaySystem\Restrictions\PersonType\check
static check($params, array $restrictionParams, $serviceId=0)
Определения
persontype.php:27
Bitrix\Sale\Services\PaySystem\Restrictions\PersonType\getClassTitle
static getClassTitle()
Определения
persontype.php:66
Bitrix\Sale\Services\PaySystem\Restrictions\PersonType\getClassDescription
static getClassDescription()
Определения
persontype.php:74
Bitrix\Sale\Services\PaySystem\Restrictions\PersonType\getOnApplyErrorMessage
static getOnApplyErrorMessage()
Определения
persontype.php:79
Bitrix\Sale\Services\PaySystem\Restrictions\PersonType\getParamsStructure
static getParamsStructure($entityId=0)
Определения
persontype.php:89
Bitrix\Sale\Services\PaySystem\Restrictions\PersonType\getSeverity
static getSeverity($mode)
Определения
persontype.php:112
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\Catalog\Restriction
Определения
toolavailabilitymanager.php:3
Bitrix\Main\Entity
Определения
ufield.php:9
$order
$order
Определения
payment.php:8
$entityId
$entityId
Определения
payment.php:4
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
services
paysystem
restrictions
persontype.php
Создано системой
1.14.0