Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
status_lang.php
1<?php
9
10use Bitrix\Main,
12
13Loc::loadMessages(__FILE__);
14
31class StatusLangTable extends Main\Entity\DataManager
32{
33 public static function getFilePath()
34 {
35 return __FILE__;
36 }
37
38 public static function getTableName()
39 {
40 return 'b_sale_status_lang';
41 }
42
43 public static function getMap()
44 {
45 return array(
46
47 new Main\Entity\StringField('STATUS_ID', array(
48 'primary' => true,
49 'format' => '/^[A-Za-z]{1,2}$/',
50 'title' => Loc::getMessage('B_SALE_STATUS_LANG_STATUS_ID'),
51 )),
52
53 new Main\Entity\StringField('LID', array(
54 'primary' => true,
55 'format' => '/^[a-z]{2}$/',
56 'title' => Loc::getMessage('B_SALE_STATUS_LANG_LID'),
57 )),
58
59 new Main\Entity\StringField('NAME', array(
60 'required' => true,
61 'title' => Loc::getMessage('B_SALE_STATUS_LANG_NAME'),
62 )),
63
64 new Main\Entity\StringField('DESCRIPTION', array(
65 'title' => Loc::getMessage('B_SALE_STATUS_LANG_DESCRIPTION'),
66 )),
67
68 new Main\Entity\ReferenceField('STATUS', 'Bitrix\Sale\Internals\StatusTable',
69 array('=this.STATUS_ID' => 'ref.ID'),
70 array('join_type' => 'INNER')
71 ),
72
73 // field for filter operation on entity
74 //'ID' => array(
75 // 'data_type' => 'string',
76 // 'expression' => array(
77 // '%s', 'STATUS_ID'
78 // )
79 //),
80
81 );
82 }
83
84 public static function deleteByStatus($statusId)
85 {
86 $result = self::getList(array(
87 'select' => array('STATUS_ID', 'LID'),
88 'filter' => array('=STATUS_ID' => $statusId)
89 ));
90
91 while ($primary = $result->fetch())
92 {
93 self::delete($primary);
94 }
95 }
96}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29