Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
agentproducttable.php
1<?php
2
3namespace Bitrix\Catalog;
4
12
40{
41 public const PRODUCT_TYPE_PRODUCT = 'PRODUCT';
42 public const PRODUCT_TYPE_SECTION = 'SECTION';
43
49 public static function getTableName(): string
50 {
51 return 'b_catalog_agent_product';
52 }
53
59 public static function getMap(): array
60 {
61 return [
62 'ID' => new IntegerField(
63 'ID',
64 [
65 'primary' => true,
66 'autocomplete' => true,
67 'title' => Loc::getMessage('CATALOG_AGENT_PRODUCT_ENTITY_ID_FIELD'),
68 ]
69 ),
70 'CONTRACT_ID' => new IntegerField(
71 'CONTRACT_ID',
72 [
73 'required' => true,
74 'title' => Loc::getMessage('CATALOG_AGENT_PRODUCT_ENTITY_CONTRACT_ID_FIELD'),
75 ]
76 ),
77 'CONTRACT' => new Reference(
78 'CONTRACT',
79 AgentContractTable::class,
80 Join::on('this.CONTRACT_ID', 'ref.ID')
81 ),
82 'PRODUCT_ID' => new IntegerField(
83 'PRODUCT_ID',
84 [
85 'required' => true,
86 'title' => Loc::getMessage('CATALOG_AGENT_PRODUCT_ENTITY_PRODUCT_ID_FIELD'),
87 ]
88 ),
89 'PRODUCT_TYPE' => new EnumField(
90 'PRODUCT_TYPE',
91 [
92 'required' => true,
93 'values' => [self::PRODUCT_TYPE_PRODUCT, self::PRODUCT_TYPE_SECTION],
94 'validation' => function()
95 {
96 return[
97 new LengthValidator(null, 8),
98 ];
99 },
100 'title' => Loc::getMessage('AGENT_PRODUCT_ENTITY_PRODUCT_TYPE_FIELD'),
101 ]
102 ),
103 ];
104 }
105}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29