1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
logright.php
См. документацию.
1<?php
8namespace Bitrix\Socialnetwork;
9
10use Bitrix\Main\Entity;
11use Bitrix\Main\DB\SqlExpression;
12use Bitrix\Main\Application;
13
30class LogRightTable extends Entity\DataManager
31{
32 public static function getTableName()
33 {
34 return 'b_sonet_log_right';
35 }
36
37 public static function getMap()
38 {
39 $fieldsMap = array(
40 'ID' => array(
41 'data_type' => 'integer',
42 'primary' => true,
43 'autocomplete' => true,
44 ),
45 'LOG_ID' => array(
46 'data_type' => 'integer',
47 'primary' => true
48 ),
49 'LOG' => array(
50 'data_type' => '\Bitrix\Socialnetwork\Log',
51 'reference' => array('=this.LOG_ID' => 'ref.ID')
52 ),
53 'GROUP_CODE' => array(
54 'data_type' => 'string',
55 ),
56 'LOG_UPDATE' => array(
57 'data_type' => 'datetime'
58 )
59 );
60
61 return $fieldsMap;
62 }
63
64 public static function setLogUpdate($params = array())
65 {
66 $logId = (isset($params['logId']) ? intval($params['logId']) : 0);
67 $value = (!empty($params['value']) ? $params['value'] : false);
68
69 if ($logId <= 0)
70 {
71 return false;
72 }
73
74 $connection = Application::getConnection();
75 $helper = $connection->getSqlHelper();
76
77 $now = $helper->getCurrentDateTimeFunction();
78 if (
79 !$value
80 || mb_strtolower($value) == mb_strtolower($now)
81 )
82 {
83 $value = new SqlExpression($now);
84 }
85
86 $updateFields = array(
87 "LOG_UPDATE" => $value,
88 );
89
90 $tableName = self::getTableName();
91 list($prefix, $values) = $helper->prepareUpdate($tableName, $updateFields);
92 $connection->queryExecute("UPDATE {$tableName} SET {$prefix} WHERE LOG_ID = ".$logId);
93
94 return true;
95 }
96
97 public static function deleteByGroupCode($value = '')
98 {
99 if ($value == '')
100 {
101 return false;
102 }
103
104 $connection = Application::getConnection();
105 $helper = $connection->getSqlHelper();
106
107 $tableName = self::getTableName();
108 $connection->queryExecute("DELETE FROM {$tableName} WHERE GROUP_CODE = '".$helper->forSql($value)."'");
109
110 return true;
111 }
112}
$connection
Определения actionsdefinitions.php:38
static getMap()
Определения logright.php:37
static setLogUpdate($params=array())
Определения logright.php:64
static deleteByGroupCode($value='')
Определения logright.php:97
static getTableName()
Определения logright.php:32
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799