1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ExportedProductTable.php
См. документацию.
1<?php
2
3namespace Bitrix\Catalog\v2\Integration\Seo\Entity;
4
5use Bitrix\Main\Entity;
6use Bitrix\Main\Localization\Loc;
7use Bitrix\Main\ORM\Fields\Validators\LengthValidator;
8use Bitrix\Main\Type\DateTime;
9
10Loc::loadMessages(__FILE__);
11
28class 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
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}
static getConnection($name="")
Определения application.php:638
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804