Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
typelanguage.php
1<?php
2namespace Bitrix\Iblock;
3
6Loc::loadMessages(__FILE__);
7
36class TypeLanguageTable extends Entity\DataManager
37{
43 public static function getTableName()
44 {
45 return 'b_iblock_type_lang';
46 }
47
53 public static function getMap()
54 {
55 return array(
56 'IBLOCK_TYPE_ID' => array(
57 'data_type' => 'string',
58 'primary' => true,
59 'validation' => array(__CLASS__, 'validateIblockTypeId'),
60 'title' => Loc::getMessage('IBLOCK_TYPE_LANG_ENTITY_IBLOCK_TYPE_ID_FIELD'),
61 ),
62 'LANGUAGE_ID' => array(
63 'data_type' => 'string',
64 'primary' => true,
65 'column_name' => 'LID',
66 'validation' => array(__CLASS__, 'validateLanguageId'),
67 'title' => Loc::getMessage('IBLOCK_TYPE_LANG_ENTITY_LID_FIELD'),
68 ),
69 'NAME' => array(
70 'data_type' => 'string',
71 'required' => true,
72 'validation' => array(__CLASS__, 'validateName'),
73 'title' => Loc::getMessage('IBLOCK_TYPE_LANG_ENTITY_NAME_FIELD'),
74 ),
75 'SECTIONS_NAME' => array(
76 'data_type' => 'string',
77 'column_name' => 'SECTION_NAME',
78 'validation' => array(__CLASS__, 'validateSectionsName'),
79 'title' => Loc::getMessage('IBLOCK_TYPE_LANG_ENTITY_SECTION_NAME_FIELD'),
80 ),
81 'ELEMENTS_NAME' => array(
82 'data_type' => 'string',
83 'column_name' => 'ELEMENT_NAME',
84 'validation' => array(__CLASS__, 'validateElementsName'),
85 'title' => Loc::getMessage('IBLOCK_TYPE_LANG_ENTITY_ELEMENT_NAME_FIELD'),
86 ),
87 'LANGUAGE' => array(
88 'data_type' => 'Bitrix\Main\Localization\Language',
89 'reference' => array('=this.LID' => 'ref.LID'),
90 ),
91 );
92 }
93
99 public static function validateIblockTypeId()
100 {
101 return array(
102 new Entity\Validator\Length(null, 50),
103 );
104 }
105
111 public static function validateLanguageId()
112 {
113 return array(
114 new Entity\Validator\Length(null, 2),
115 );
116 }
117
123 public static function validateName()
124 {
125 return array(
126 new Entity\Validator\Length(null, 100),
127 );
128 }
129
135 public static function validateSectionsName()
136 {
137 return array(
138 new Entity\Validator\Length(null, 100),
139 );
140 }
141
147 public static function validateElementsName()
148 {
149 return array(
150 new Entity\Validator\Length(null, 100),
151 );
152 }
153
162 public static function deleteByIblockTypeId($iblockTypeId)
163 {
164 $connection = \Bitrix\Main\Application::getConnection();
165 $helper = $connection->getSqlHelper();
166 $entity = self::getEntity();
167
168 $sql = "DELETE FROM ".$entity->getDBTableName()." WHERE IBLOCK_TYPE_ID = '".$helper->forSql($iblockTypeId)."'";
169 $connection->queryExecute($sql);
170
171 $result = new \Bitrix\Main\Entity\DeleteResult();
172 return $result;
173 }
174}
static deleteByIblockTypeId($iblockTypeId)
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29