Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
authortable.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\ManyToMany
;
14
use
Bitrix\Main\ORM\Fields\StringField
;
15
33
class
AuthorTable
extends
DataManager
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
}
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\Relations\ManyToMany
Definition
manytomany.php:26
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\Test\Typography\AuthorTable
Definition
authortable.php:34
Bitrix\Main\Test\Typography\AuthorTable\getMap
static getMap()
Definition
authortable.php:44
Bitrix\Main\Test\Typography\AuthorTable\getTableName
static getTableName()
Definition
authortable.php:35
Bitrix\Main\Test\Typography
Definition
authortable.php:9
modules
main
lib
test
typography
authortable.php
Создано системой
1.10.0