Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
storeproduct.php
1
<?php
2
namespace
Bitrix\Catalog
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\ORM
;
7
38
class
StoreProductTable
extends
ORM\Data\DataManager
39
{
45
public
static
function
getTableName
()
46
{
47
return
'b_catalog_store_product'
;
48
}
49
55
public
static
function
getMap
()
56
{
57
return
[
58
'ID'
=>
new
ORM\Fields\IntegerField
(
59
'ID'
,
60
[
61
'primary'
=>
true
,
62
'autocomplete'
=>
true
,
63
'title'
=>
Loc::getMessage
(
'STORE_PRODUCT_ENTITY_ID_FIELD'
),
64
]
65
),
66
'STORE_ID'
=>
new
ORM\Fields\IntegerField
(
67
'STORE_ID'
,
68
[
69
'required'
=>
true
,
70
'title'
=>
Loc::getMessage
(
'STORE_PRODUCT_ENTITY_STORE_ID_FIELD'
),
71
]
72
),
73
'PRODUCT_ID'
=>
new
ORM\Fields\IntegerField
(
74
'PRODUCT_ID'
,
75
[
76
'required'
=>
true
,
77
'title'
=>
Loc::getMessage
(
'STORE_PRODUCT_ENTITY_PRODUCT_ID_FIELD'
),
78
]
79
),
80
'AMOUNT'
=>
new
ORM\Fields\FloatField
(
81
'AMOUNT'
,
82
[
83
'title'
=>
Loc::getMessage
(
'STORE_PRODUCT_ENTITY_AMOUNT_FIELD'
),
84
]
85
),
86
'QUANTITY_RESERVED'
=>
new
ORM\Fields\FloatField
(
87
'QUANTITY_RESERVED'
,
88
[
89
'title'
=>
Loc::getMessage
(
'STORE_PRODUCT_ENTITY_QUANTITY_RESERVED_FIELD'
),
90
]
91
),
92
'STORE'
=>
new
ORM\Fields\Relations\Reference
(
93
'STORE'
,
94
StoreTable::class,
95
ORM\
Query
\Join::on(
'this.STORE_ID'
,
'ref.ID'
)
96
),
97
'PRODUCT'
=>
new
ORM\Fields\Relations\Reference
(
98
'PRODUCT'
,
99
ProductTable::class,
100
ORM\
Query
\Join::on(
'this.PRODUCT_ID'
,
'ref.ID'
)
101
),
102
];
103
}
104
112
public
static
function
deleteByProduct
(
int
$id): void
113
{
114
if
($id <= 0)
115
{
116
return
;
117
}
118
119
$conn = Main\Application::getConnection();
120
$helper = $conn->getSqlHelper();
121
$conn->queryExecute(
122
'delete from '
. $helper->quote(self::getTableName())
123
.
' where '
. $helper->quote(
'PRODUCT_ID'
) .
' = '
. $id
124
);
125
unset($helper, $conn);
126
}
127
}
Bitrix\Catalog\StoreProductTable
Definition
storeproduct.php:39
Bitrix\Catalog\StoreProductTable\getMap
static getMap()
Definition
storeproduct.php:55
Bitrix\Catalog\StoreProductTable\deleteByProduct
static deleteByProduct(int $id)
Definition
storeproduct.php:112
Bitrix\Catalog\StoreProductTable\getTableName
static getTableName()
Definition
storeproduct.php:45
Bitrix\Iblock\ORM\Query
Definition
query.php:23
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\FloatField
Definition
floatfield.php:20
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\Relations\Reference
Definition
reference.php:26
Bitrix\Catalog
Bitrix\Main\ORM
Bitrix\Main
modules
catalog
lib
storeproduct.php
Создано системой
1.10.0