Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
storebooktable.php
1<?php
10
15
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}