1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
persontype.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Services\PaySystem\Restrictions;
4
5use Bitrix\Main\Error;
6use Bitrix\Main\Localization\Loc;
7use Bitrix\Main\Result;
8use Bitrix\Sale\Internals\CollectableEntity;
9use Bitrix\Sale\Internals\Entity;
10use Bitrix\Sale\Order;
11use Bitrix\Sale\PaymentCollection;
12use Bitrix\Sale\PaySystem\ClientType;
13use Bitrix\Sale\PaySystem\Service;
14use Bitrix\Sale\Registry;
15use Bitrix\Sale\Services\Base;
16
17Loc::loadMessages(__FILE__);
18
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 {
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
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 {
115 }
116}
static getList(array $parameters=[])
Определения persontype.php:100
static check($params, array $restrictionParams, $serviceId=0)
Определения persontype.php:27
static getParamsStructure($entityId=0)
Определения persontype.php:89
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$entity
Определения ufield.php:9
$order
Определения payment.php:8
$entityId
Определения payment.php:4
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$dbRes
Определения yandex_detail.php:168