Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
storebooktable.php
1
<?php
9
namespace
Bitrix\Main\Test\Typography
;
10
11
use
Bitrix\Main\ORM\Data\DataManager
;
12
use
Bitrix\Main\ORM\Fields\IntegerField
;
13
use
Bitrix\Main\ORM\Fields\Relations\Reference
;
14
use
Bitrix\Main\ORM\Query\Join
;
15
33
class
StoreBookTable
extends
DataManager
34
{
35
public
static
function
getTableName
()
36
{
37
return
'(
38
(SELECT 33 AS STORE_ID, 1 AS BOOK_ID, 4 AS QUANTITY)
39
UNION
40
(SELECT 33 AS STORE_ID, 2 AS BOOK_ID, 0 AS QUANTITY)
41
UNION
42
(SELECT 34 AS STORE_ID, 2 AS BOOK_ID, 9 AS QUANTITY)
43
)'
;
44
}
45
46
public
static
function
getMap
()
47
{
48
return
[
49
(
new
IntegerField
(
'STORE_ID'
))
50
->configurePrimary(),
51
52
(
new
Reference
(
'STORE'
, StoreTable::class,
53
Join::on(
'this.STORE_ID'
,
'ref.ID'
)))
54
->configureJoinType(
'inner'
),
55
56
(
new
IntegerField
(
'BOOK_ID'
))
57
->configurePrimary(),
58
59
(
new
Reference
(
'BOOK'
, BookTable::class,
60
Join::on(
'this.BOOK_ID'
,
'ref.ID'
)))
61
->configureJoinType(
'inner'
),
62
63
(
new
IntegerField
(
'QUANTITY'
))
64
->configureDefaultValue(0)
65
];
66
}
67
}
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\Relations\Reference
Definition
reference.php:26
Bitrix\Main\ORM\Query\Join
Definition
join.php:19
Bitrix\Main\Test\Typography\StoreBookTable
Definition
storebooktable.php:34
Bitrix\Main\Test\Typography\StoreBookTable\getMap
static getMap()
Definition
storebooktable.php:46
Bitrix\Main\Test\Typography\StoreBookTable\getTableName
static getTableName()
Definition
storebooktable.php:35
Bitrix\Main\Test\Typography
Definition
authortable.php:9
modules
main
lib
test
typography
storebooktable.php
Создано системой
1.10.0