Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
publishertable.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\StringField
;
14
15
use
Bitrix\Main\ORM\Fields\Relations\OneToMany
;
16
34
class
PublisherTable
extends
DataManager
35
{
36
public
static
function
getTableName
()
37
{
38
return
'(
39
(SELECT 253 AS ID, "Publisher Title 253" AS TITLE, 2 AS BOOKS_COUNT)
40
UNION
41
(SELECT 254 AS ID, "Publisher Title 254" AS TITLE, 0 AS BOOKS_COUNT)
42
)'
;
43
}
44
45
public
static
function
getMap
()
46
{
47
return
[
48
(
new
IntegerField
(
'ID'
))
49
->configurePrimary()
50
->configureAutocomplete(),
51
52
(
new
StringField
(
'TITLE'
)),
53
54
(
new
IntegerField
(
'BOOKS_COUNT'
)),
55
56
(
new
OneToMany
(
'BOOKS'
, BookTable::class,
'PUBLISHER'
))
57
->configureJoinType(
'left'
)
58
];
59
}
60
61
}
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\Relations\OneToMany
Definition
onetomany.php:23
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\Test\Typography\PublisherTable
Definition
publishertable.php:35
Bitrix\Main\Test\Typography\PublisherTable\getMap
static getMap()
Definition
publishertable.php:45
Bitrix\Main\Test\Typography\PublisherTable\getTableName
static getTableName()
Definition
publishertable.php:36
Bitrix\Main\Test\Typography
Definition
authortable.php:9
modules
main
lib
test
typography
publishertable.php
Создано системой
1.10.0