Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
addressfieldtable.php
1
<?php
2
3
namespace
Bitrix\Location\Model
;
4
5
use
Bitrix\Main
;
6
use
Bitrix\Main\ORM\Fields
;
7
use
Bitrix\Main\ORM\Query\Join
;
8
25
class
AddressFieldTable
extends
Main\ORM\Data\DataManager
26
{
32
public
static
function
getTableName
()
33
{
34
return
'b_location_addr_fld'
;
35
}
36
42
public
static
function
getMap
()
43
{
44
return
[
45
46
(
new
Fields\IntegerField(
'ADDRESS_ID'
))
47
->configureRequired(
true
)
48
->configurePrimary(
true
),
49
50
(
new
Fields\IntegerField(
'TYPE'
))
51
->configureRequired(
true
)
52
->configurePrimary(
true
),
53
54
(
new
Fields\StringField(
'VALUE'
))
55
->addValidator(
new
Main\ORM\Fields\Validators\
LengthValidator
(
null
, 1024)),
56
57
(
new
Fields\
StringField
(
'VALUE_NORMALIZED'
))
58
->addValidator(
new
Main\ORM\Fields\Validators\
LengthValidator
(
null
, 1024)),
59
60
// Ref
61
62
(
new
Fields\Relations\
Reference
(
'ADDRESS'
, AddressTable::class,
63
Join::on(
'this.ADDRESS_ID'
,
'ref.ID'
)))
64
->configureJoinType(
'inner'
)
65
];
66
}
67
68
public
static
function
deleteByAddressId
(
int
$addressId)
69
{
70
Main\Application::getConnection()->queryExecute(
"
71
DELETE
72
FROM "
.self::getTableName().
"
73
WHERE
74
ADDRESS_ID="
.(
int
)$addressId
75
);
76
}
77
}
Bitrix\Location\Model\AddressFieldTable
Definition
addressfieldtable.php:26
Bitrix\Location\Model\AddressFieldTable\getMap
static getMap()
Definition
addressfieldtable.php:42
Bitrix\Location\Model\AddressFieldTable\deleteByAddressId
static deleteByAddressId(int $addressId)
Definition
addressfieldtable.php:68
Bitrix\Location\Model\AddressFieldTable\getTableName
static getTableName()
Definition
addressfieldtable.php:32
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
addressfieldtable.php
Создано системой
1.10.0