1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
bypersontype.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Delivery\Restrictions;
4
5use Bitrix\Sale\Internals\CollectableEntity;
6use Bitrix\Sale\Internals\Entity;
7use Bitrix\Sale\Internals\PersonTypeTable;
8use Bitrix\Sale\ShipmentCollection;
9use Bitrix\Main\Localization\Loc;
10use Bitrix\Sale\Order;
11
12Loc::loadMessages(__FILE__);
13
14class 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 {
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
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 {
105 }
106}
static check($personTypeId, array $params, $deliveryId=0)
Определения bypersontype.php:22
static getParamsStructure($deliveryId=0)
Определения bypersontype.php:79
static getList(array $parameters=[])
Определения persontype.php:100
</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
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