Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
entitytype.php
1<?php
3
13
14Loc::loadMessages(__FILE__);
15
17{
18 const ENTITY_NONE = 'N';
19 const ENTITY_PAYMENT = 'P';
20 const ENTITY_SHIPMENT = 'S';
21 const ENTITY_ORDER = 'O';
22
26 public static function getClassTitle()
27 {
28 return Loc::getMessage('SALE_COMPANY_RULES_BY_ENTITY_TITLE');
29 }
30
34 public static function getClassDescription()
35 {
36 return Loc::getMessage('SALE_COMPANY_RULES_BY_ENTITY_DESC');
37 }
38
39
44 public static function getParamsStructure($entityId = 0)
45 {
46 return array(
47 "ENTITY_TYPE" => array(
48 "TYPE" => "ENUM",
49 "LABEL" => Loc::getMessage("SALE_COMPANY_RULES_BY_ENTITY"),
50 "OPTIONS" => array(
51 self::ENTITY_NONE => Loc::getMessage('SALE_COMPANY_RULES_BY_ENTITY_NONE'),
52 self::ENTITY_PAYMENT => Loc::getMessage('SALE_COMPANY_RULES_BY_ENTITY_PAYMENT'),
53 self::ENTITY_SHIPMENT => Loc::getMessage('SALE_COMPANY_RULES_BY_ENTITY_SHIPMENT'),
54 self::ENTITY_ORDER => Loc::getMessage('SALE_COMPANY_RULES_BY_ENTITY_ORDER'),
55 )
56 )
57 );
58 }
59
60
65 protected static function extractParams(Internals\Entity $entity)
66 {
68 if ($entity instanceof Payment)
70
71 if ($entity instanceof Shipment)
73
74 if ($entity instanceof Order)
75 return self::ENTITY_ORDER;
76
77 return self::ENTITY_NONE;
78 }
79
86 public static function check($params, array $restrictionParams, $serviceId = 0)
87 {
88 return $params == $restrictionParams['ENTITY_TYPE'];
89 }
90
95 public static function getSeverity($mode)
96 {
97 return Company\Restrictions\Manager::SEVERITY_STRICT;
98 }
99}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static extractParams(Entity $entity)
static check($params, array $restrictionParams, $serviceId=0)