1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
ExportedProductTable.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Catalog\v2\Integration\Seo\Entity;
4
5
use Bitrix\Main\Entity;
6
use Bitrix\Main\Localization\Loc;
7
use Bitrix\Main\ORM\Fields\Validators\LengthValidator;
8
use Bitrix\Main\Type\DateTime;
9
10
Loc::loadMessages(__FILE__);
11
28
class
ExportedProductTable
extends
Entity\DataManager
29
{
30
public
static
function
getTableName
()
31
{
32
return
'b_catalog_exported_product'
;
33
}
34
35
public
static
function
getObjectClass
()
36
{
37
return
ExportedProduct::class;
38
}
39
40
public
static
function
getCollectionClass
()
41
{
42
return
ExportedProductCollection::class;
43
}
44
45
public
static
function
getMap
()
46
{
47
return
[
48
'ID'
=> [
49
'data_type'
=>
'integer'
,
50
'primary'
=>
true
,
51
],
52
'PRODUCT_ID'
=> [
53
'data_type'
=>
'integer'
,
54
'required'
=>
true
,
55
],
56
'SERVICE_ID'
=> [
57
'data_type'
=>
'string'
,
58
'validation'
=> [__CLASS__,
'validateServiceId'
],
59
'required'
=>
true
,
60
],
61
'TIMESTAMP_X'
=> [
62
'data_type'
=>
'datetime'
,
63
'required'
=>
true
,
64
'default_value'
=>
function
()
65
{
66
return
new
DateTime
();
67
},
68
],
69
'ERROR'
=> [
70
'data_type'
=>
'text'
,
71
'required'
=>
false
,
72
],
73
];
74
}
75
76
public
static
function
validateServiceId
():
array
77
{
78
return
[
79
new
LengthValidator
(
null
, 100),
80
];
81
}
82
83
public
static
function
deleteProduct
(
int
$id): void
84
{
85
if
($id <= 0)
86
{
87
return
;
88
}
89
90
$conn =
\Bitrix\Main\Application::getConnection
();
91
$helper = $conn->getSqlHelper();
92
$conn->queryExecute(
93
'delete from '
. $helper->quote(self::getTableName())
94
.
' where '
. $helper->quote(
'PRODUCT_ID'
) .
' = '
. $id
95
);
96
unset($helper, $conn);
97
}
98
}
Bitrix\Catalog\v2\Integration\Seo\Entity\ExportedProductTable
Определения
ExportedProductTable.php:29
Bitrix\Catalog\v2\Integration\Seo\Entity\ExportedProductTable\getMap
static getMap()
Определения
ExportedProductTable.php:45
Bitrix\Catalog\v2\Integration\Seo\Entity\ExportedProductTable\validateServiceId
static validateServiceId()
Определения
ExportedProductTable.php:76
Bitrix\Catalog\v2\Integration\Seo\Entity\ExportedProductTable\deleteProduct
static deleteProduct(int $id)
Определения
ExportedProductTable.php:83
Bitrix\Catalog\v2\Integration\Seo\Entity\ExportedProductTable\getObjectClass
static getObjectClass()
Определения
ExportedProductTable.php:35
Bitrix\Catalog\v2\Integration\Seo\Entity\ExportedProductTable\getTableName
static getTableName()
Определения
ExportedProductTable.php:30
Bitrix\Catalog\v2\Integration\Seo\Entity\ExportedProductTable\getCollectionClass
static getCollectionClass()
Определения
ExportedProductTable.php:40
Bitrix\Main\Application\getConnection
static getConnection($name="")
Определения
application.php:638
Bitrix\Main\ORM\Fields\Validators\LengthValidator
Определения
lengthvalidator.php:19
Bitrix\Main\Type\DateTime
Определения
datetime.php:9
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
bitrix
modules
catalog
lib
v2
Integration
Seo
Entity
ExportedProductTable.php
Создано системой
1.14.0