1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
extra.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog;
4
5use Bitrix\Main\Localization\Loc;
6use Bitrix\Main\ORM;
7use Bitrix\Catalog\Model;
8
34
36{
42 public static function getTableName()
43 {
44 return 'b_catalog_extra';
45 }
46
52 public static function getMap()
53 {
54 return [
55 'ID' => new ORM\Fields\IntegerField(
56 'ID',
57 [
58 'primary' => true,
59 'autocomplete' => true,
60 'title' => Loc::getMessage('EXTRA_ENTITY_ID_FIELD'),
61 ]
62 ),
63 'NAME' => new ORM\Fields\StringField(
64 'NAME',
65 [
66 'required' => true,
67 'validation' => function()
68 {
69 return [
71 ];
72 },
73 'title' => Loc::getMessage('EXTRA_ENTITY_NAME_FIELD'),
74 ]
75 ),
76 'PERCENTAGE' => new ORM\Fields\FloatField(
77 'PERCENTAGE',
78 [
79 'required' => true,
80 'title' => Loc::getMessage('EXTRA_ENTITY_PERCENTAGE_FIELD'),
81 ]
82 )
83 ];
84 }
85
92 public static function onAfterAdd(ORM\Event $event): void
93 {
95 }
96
103 public static function onAfterUpdate(ORM\Event $event): void
104 {
106 }
107
114 public static function onAfterDelete(ORM\Event $event): void
115 {
117 }
118
124 public static function getExtraList(): array
125 {
126 $result = [];
127
129 'select' => [
130 'ID',
131 'NAME',
132 'PERCENTAGE',
133 ],
134 'order' => [
135 'ID' => 'ASC',
136 ],
137 'cache' => [
138 'ttl' => 86400,
139 ],
140 ]);
141 while ($row = $iterator->fetch())
142 {
143 $row['ID'] = (int)$row['ID'];
144 $row['PERCENTAGE'] = (float)$row['PERCENTAGE'];
145
146 $result[$row['ID']] = $row;
147 }
148 unset($row, $iterator);
149
150 return $result;
151 }
152}
static getMap()
Определения extra.php:52
static onAfterDelete(ORM\Event $event)
Определения extra.php:114
static onAfterAdd(ORM\Event $event)
Определения extra.php:92
static onAfterUpdate(ORM\Event $event)
Определения extra.php:103
static getExtraList()
Определения extra.php:124
static getTableName()
Определения extra.php:42
static clearSettings()
Определения price.php:762
static getList(array $parameters=array())
Определения datamanager.php:431
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
Определения buffer.php:3
$event
Определения prolog_after.php:141
$iterator
Определения yandex_run.php:610