1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
FreeAppTable.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Rest\Internals
;
4
5
use
Bitrix\Main\Application
;
6
use
Bitrix\Main\DB\SqlQueryException
;
7
use
Bitrix\Main\ORM\Data\DataManager
;
8
use
Bitrix\Main\ORM\Fields\Relations\Reference
;
9
use
Bitrix\Main\ORM\Fields\StringField
;
10
use
Bitrix\Main\ORM\Query\Join
;
11
use
Bitrix\Rest\AppTable
;
12
29
class
FreeAppTable
extends
DataManager
30
{
31
public
static
function
getTableName
()
32
{
33
return
'b_rest_free_app'
;
34
}
35
36
public
static
function
getMap
()
37
{
38
return
[
39
new
StringField
(
'APP_CODE'
, [
40
'primary'
=>
true
,
41
]),
42
(
new
Reference
(
43
'APP'
,
44
AppTable::class,
45
Join::on(
'this.APP_CODE'
,
'ref.CODE'
)
46
)),
47
];
48
}
49
50
final
public
static
function
updateFreeAppTable
(
array
$freeAppList): void
51
{
52
$connection
= Application::getConnection();
53
$connection
->startTransaction();
54
55
try
56
{
57
$connection
->truncateTable(
FreeAppTable::getTableName
());
58
$helper =
$connection
->getSqlHelper();
59
60
if
(!empty($freeAppList))
61
{
62
$values = implode(
"'),('"
, $freeAppList);
63
$query
= $helper->getInsertIgnore(
FreeAppTable::getTableName
(),
'(APP_CODE)'
,
"VALUES ('$values')"
);
64
$connection
->query(
$query
);
65
}
66
}
67
catch
(
SqlQueryException
$e)
68
{
69
$connection
->rollbackTransaction();
70
throw
$e;
71
}
72
73
$connection
->commitTransaction();
74
self::cleanCache
();
75
}
76
}
$connection
$connection
Определения
actionsdefinitions.php:38
Bitrix\Main\Application
Определения
application.php:30
Bitrix\Main\DB\SqlQueryException
Определения
sqlqueryexception.php:9
Bitrix\Main\ORM\Data\DataManager
Определения
datamanager.php:35
Bitrix\Main\ORM\Data\DataManager\cleanCache
static cleanCache()
Определения
datamanager.php:1983
Bitrix\Main\ORM\Fields\Relations\Reference
Определения
reference.php:26
Bitrix\Main\ORM\Fields\StringField
Определения
stringfield.php:20
Bitrix\Main\ORM\Query\Join
Определения
join.php:19
Bitrix\Rest\AppTable
Определения
app.php:68
Bitrix\Rest\Internals\FreeAppTable
Определения
FreeAppTable.php:30
Bitrix\Rest\Internals\FreeAppTable\getMap
static getMap()
Определения
FreeAppTable.php:36
Bitrix\Rest\Internals\FreeAppTable\updateFreeAppTable
static updateFreeAppTable(array $freeAppList)
Определения
FreeAppTable.php:50
Bitrix\Rest\Internals\FreeAppTable\getTableName
static getTableName()
Определения
FreeAppTable.php:31
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$query
$query
Определения
get_search.php:11
Bitrix\Rest\Internals
Определения
FreeAppTable.php:3
bitrix
modules
rest
lib
Internals
FreeAppTable.php
Создано системой
1.14.0