Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
authortable.php
1<?php
10
15
34{
35 public static function getTableName()
36 {
37 return '(
38 (SELECT 17 AS ID, "Name 17" AS NAME, "Last name 17" as LAST_NAME)
39 UNION
40 (SELECT 18 AS ID, "Name 18" AS NAME, "Last name 18" as LAST_NAME)
41 )';
42 }
43
44 public static function getMap()
45 {
46 return [
47 (new IntegerField('ID'))
48 ->configurePrimary()
49 ->configureAutocomplete(),
50
51 (new StringField('NAME')),
52
53 (new StringField('LAST_NAME')),
54
55 (new ManyToMany('BOOKS', BookTable::class))
56 ->configureMediatorTableName('(
57 (SELECT 1 AS BOOK_ID, 18 AS AUTHOR_ID)
58 UNION
59 (SELECT 2 AS BOOK_ID, 17 AS AUTHOR_ID)
60 UNION
61 (SELECT 2 AS BOOK_ID, 18 AS AUTHOR_ID)
62 )'),
63 ];
64 }
65}