Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
dbresult.php
1<?php
8namespace Bitrix\Vote;
9
10use \Bitrix\Main\Localization\Loc;
11Loc::loadMessages(__FILE__);
12
13class DBResult extends \CDBResult
14{
18 function fetch()
19 {
20 if ($res = parent::fetch())
21 {
22 $prefix = null;
23 foreach ($res as $k => $v)
24 {
25 if (mb_strpos($k, "LAMP") !== false)
26 {
27 $prefix = mb_substr($k, 0, mb_strpos($k, "LAMP"));
28 break;
29 }
30 }
31 if ($prefix !== null && $res[$prefix."LAMP"] == "yellow" && !empty($res[$prefix."CHANNEL_ID"]))
32 {
33 $res[$prefix."LAMP"] = ($res[$prefix."ID"] == \CVote::getActiveVoteId($res[$prefix."CHANNEL_ID"]) ? "green" : "red");
34 }
35 }
36 return $res;
37 }
38}
static loadMessages($file)
Definition loc.php:64