Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
locationnametable.php
1
<?php
2
namespace
Bitrix\Location\Model
;
3
4
use
Bitrix\Main
;
5
use
Bitrix\Main\Application
;
6
use
Bitrix\Main\ORM\Fields\Relations\Reference
;
7
use
Bitrix\Main\ORM\Query\Join
;
8
use
Bitrix\Main\ORM\Fields
;
9
27
class
LocationNameTable
extends
Main\ORM\Data\DataManager
28
{
34
public
static
function
getTableName
()
35
{
36
return
'b_location_name'
;
37
}
38
44
public
static
function
getMap
()
45
{
46
return
[
47
(
new
Fields\IntegerField(
'LOCATION_ID'
))
48
->configurePrimary(
true
)
49
->configureRequired(
true
),
50
51
(
new
Fields\StringField(
'LANGUAGE_ID'
))
52
->configurePrimary(
true
)
53
->configureRequired(
true
)
54
->addValidator(
new
Main\ORM\Fields\Validators\
LengthValidator
(2, 2)),
55
56
(
new
Fields\
StringField
(
'NAME'
))
57
->configureRequired(
true
)
58
->addValidator(
new
Main\ORM\Fields\Validators\
LengthValidator
(1, 1000)),
59
60
(
new
Fields\
StringField
(
'NAME_NORMALIZED'
))
61
->addValidator(
new
Main\ORM\Fields\Validators\
LengthValidator
(
null
, 1000)),
62
63
// Ref
64
65
(
new
Reference
(
'LOCATION'
, LocationTable::class,
66
Join::on(
'this.LOCATION_ID'
,
'ref.ID'
)))
67
->configureJoinType(
'inner'
)
68
];
69
}
70
75
public
static
function
deleteByLocationId
(
int
$locationId)
76
{
77
Application::getConnection
()->queryExecute(
"
78
DELETE
79
FROM "
.self::getTableName().
"
80
WHERE LOCATION_ID="
.(
int
)$locationId
81
);
82
}
83
}
Bitrix\Location\Model\LocationNameTable
Definition
locationnametable.php:28
Bitrix\Location\Model\LocationNameTable\getMap
static getMap()
Definition
locationnametable.php:44
Bitrix\Location\Model\LocationNameTable\deleteByLocationId
static deleteByLocationId(int $locationId)
Definition
locationnametable.php:75
Bitrix\Location\Model\LocationNameTable\getTableName
static getTableName()
Definition
locationnametable.php:34
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getConnection
static getConnection($name="")
Definition
application.php:611
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Fields\Relations\Reference
Definition
reference.php:26
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\ORM\Fields\Validators\LengthValidator
Definition
lengthvalidator.php:19
Bitrix\Main\ORM\Query\Join
Definition
join.php:19
Bitrix\Location\Model
Definition
addressfieldtable.php:3
Bitrix\Main\ORM\Fields
Definition
arrayfield.php:9
Bitrix\Main
modules
location
lib
model
locationnametable.php
Создано системой
1.10.0