Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
propertyfeature.php
1<?php
2namespace Bitrix\Iblock;
3
7
8Loc::loadMessages(__FILE__);
9
40{
46 public static function getTableName()
47 {
48 return 'b_iblock_property_feature';
49 }
50
56 public static function getMap()
57 {
58 return [
59 'ID' => new ORM\Fields\IntegerField('ID', [
60 'primary' => true,
61 'autocomplete' => true,
62 'title' => Loc::getMessage('PROPERTY_FEATURE_ENTITY_ID_FIELD')
63 ]),
64 'PROPERTY_ID' => new ORM\Fields\IntegerField('PROPERTY_ID', [
65 'title' => Loc::getMessage('PROPERTY_FEATURE_ENTITY_PROPERTY_ID_FIELD')
66 ]),
67 'MODULE_ID' => new ORM\Fields\StringField('MODULE_ID', [
68 'validation' => [__CLASS__, 'validateModuleId'],
69 'title' => Loc::getMessage('PROPERTY_FEATURE_ENTITY_MODULE_ID_FIELD')
70 ]),
71 'FEATURE_ID' => new ORM\Fields\StringField('FEATURE_ID', [
72 'validation' => [__CLASS__, 'validateFeatureId'],
73 'title' => Loc::getMessage('PROPERTY_FEATURE_ENTITY_FEATURE_ID_FIELD')
74 ]),
75 'IS_ENABLED' => new ORM\Fields\BooleanField('IS_ENABLED', [
76 'values' => ['N', 'Y'],
77 'default_value' => 'N',
78 'title' => Loc::getMessage('PROPERTY_FEATURE_ENTITY_IS_ENABLED_FIELD')
79 ]),
80 'PROPERTY' => new ORM\Fields\Relations\Reference(
81 'PROPERTY',
82 '\Bitrix\Iblock\Property',
83 ['=this.PROPERTY_ID' => 'ref.ID']
84 )
85 ];
86 }
87
93 public static function validateModuleId()
94 {
95 return [
97 ];
98 }
99
105 public static function validateFeatureId()
106 {
107 return [
109 ];
110 }
111
118 public static function deleteByProperty($property)
119 {
120 $property = (int)$property;
121 if ($property <= 0)
122 return;
123 $conn = Main\Application::getConnection();
124 $helper = $conn->getSqlHelper();
125 $conn->queryExecute(
126 'delete from '.$helper->quote(self::getTableName()).' where '.$helper->quote('PROPERTY_ID').' = '.$property
127 );
128 unset($helper, $conn);
129 }
130}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29