1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
question.php
См. документацию.
1<?php
8namespace Bitrix\Vote;
9use \Bitrix\Main\Entity;
10use \Bitrix\Main\Localization\Loc;
11Loc::loadMessages(__FILE__);
12
44class QuestionTable extends Entity\DataManager
45{
51 public static function getTableName()
52 {
53 return 'b_vote_question';
54 }
55
61 public static function getMap()
62 {
63 return array(
64 'ID' => array(
65 'data_type' => 'integer',
66 'primary' => true,
67 'autocomplete' => true,
68 'title' => Loc::getMessage('V_TABLE_FIELD_ID'),
69 ),
70 'ACTIVE' => array(
71 'data_type' => 'boolean',
72 'values' => array('N', 'Y'),
73 'default_value' => 'Y',
74 'title' => Loc::getMessage('V_TABLE_FIELD_ACTIVE')
75 ),
76 'TIMESTAMP_X' => array(
77 'data_type' => 'datetime',
78 'title' => Loc::getMessage('V_TABLE_FIELD_TIMESTAMP_X'),
79 ),
80 'VOTE_ID' => array(
81 'data_type' => 'integer',
82 'title' => Loc::getMessage('V_TABLE_FIELD_VOTE_ID'),
83 ),
84 'C_SORT' => array(
85 'data_type' => 'integer',
86 'title' => Loc::getMessage('V_TABLE_FIELD_C_SORT'),
87 ),
88 'COUNTER' => array(
89 'data_type' => 'integer',
90 'title' => Loc::getMessage('V_TABLE_FIELD_COUNTER'),
91 ),
92 'QUESTION' => array(
93 'data_type' => 'text',
94 'title' => Loc::getMessage('V_TABLE_FIELD_QUESTION'),
95 'save_data_modification' => array('\Bitrix\Main\Text\Emoji', 'getSaveModificator'),
96 'fetch_data_modification' => array('\Bitrix\Main\Text\Emoji', 'getFetchModificator'),
97 ),
98 'QUESTION_TYPE' => array(
99 'data_type' => 'enum',
100 'values' => array("text", "html"),
101 'default_value' => "text",
102 'title' => Loc::getMessage('V_TABLE_FIELD_QUESTION_TYPE'),
103 ),
104 'IMAGE_ID' => array(
105 'data_type' => 'integer',
106 'title' => Loc::getMessage('V_TABLE_FIELD_IMAGE_ID'),
107 ),
108 'IMAGE' => array(
109 'data_type' => '\Bitrix\Main\FileTable',
110 'reference' => array(
111 '=this.IMAGE_ID' => 'ref.ID',
112 ),
113 'join_type' => 'LEFT',
114 'title' => Loc::getMessage('V_TABLE_FIELD_IMAGE'),
115 ),
116 'DIAGRAM' => array(
117 'data_type' => 'boolean',
118 'values' => array('N', 'Y'),
119 'default_value' => 'Y',
120 'title' => Loc::getMessage('V_TABLE_FIELD_DIAGRAM')
121 ),
122 'DIAGRAM_TYPE' => array(
123 'data_type' => 'enum',
124 'values' => array("histogram", "circle"),
125 'default_value' => "histogram",
126 'title' => Loc::getMessage('V_TABLE_FIELD_DIAGRAM_TYPE'),
127 ),
128 'REQUIRED' => array(
129 'data_type' => 'boolean',
130 'values' => array('N', 'Y'),
131 'default_value' => 'N',
132 'title' => Loc::getMessage('V_TABLE_FIELD_REQUIRED')
133 ),
134 'FIELD_TYPE' => array(
135 'data_type' => 'enum',
136 'values' => \Bitrix\Vote\QuestionTypes::getValues(),
137 'default_value' => '0',
138 'title' => Loc::getMessage('V_TABLE_FIELD_FIELD_TYPE')
139 ),
140 'VOTE' => array(
141 'data_type' => '\Bitrix\Vote\VoteTable',
142 'reference' => array(
143 '=this.VOTE_ID' => 'ref.ID',
144 ),
145 'join_type' => 'RIGHT',
146 ),
147 'ANSWER' => array(
148 'data_type' => '\Bitrix\Vote\AnswerTable',
149 'reference' => array(
150 '=this.ID' => 'ref.QUESTION_ID',
151 ),
152 'join_type' => 'LEFT',
153 )
154 );
155 }
156
161 public static function setCounter(array $id, $increment = true)
162 {
163 $id = implode(", ", $id);
164 if (empty($id))
165 return;
167 $sql = intval($increment);
168 if ($increment === true)
169 $sql = "COUNTER+1";
170 else if ($increment === false)
171 $sql = "COUNTER-1";
172 $connection->queryExecute("UPDATE ".self::getTableName()." SET COUNTER=".$sql." WHERE ID IN (".$id.")");
173 }
174}
175
177{
178 public static $storage = array();
179}
$connection
Определения actionsdefinitions.php:38
static getInstance()
Определения application.php:98
static $storage
Определения question.php:178
static getMap()
Определения question.php:61
static setCounter(array $id, $increment=true)
Определения question.php:161
static getTableName()
Определения question.php:51
static getValues()
Определения questiontypes.php:25
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения anonymity.php:8