1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
locationtable.php
См. документацию.
1<?php
2namespace Bitrix\Location\Model;
3
4use Bitrix\Location\Entity\Location\Type;
5use Bitrix\Main;
6use Bitrix\Main\ORM\Fields;
7use Bitrix\Main\ORM\Query\Join;
8use Bitrix\Main\ORM\Fields\Relations;
9
41
43{
49 public static function getTableName()
50 {
51 return 'b_location';
52 }
53
59 public static function getMap()
60 {
61 return [
62 (new Fields\IntegerField('ID'))
63 ->configurePrimary(true)
64 ->configureAutocomplete(true),
65
66 (new Fields\StringField('CODE'))
67 ->addValidator(new Main\ORM\Fields\Validators\LengthValidator(1, 100))
68 ->configureUnique(true)
69 ->configureRequired(true),
70
71 (new Fields\StringField('EXTERNAL_ID'))
72 ->addValidator(new Main\ORM\Fields\Validators\LengthValidator(null, 255)),
73
74 (new Fields\StringField('SOURCE_CODE'))
75 ->addValidator(new Main\ORM\Fields\Validators\LengthValidator(null, 15)),
76
77 new Fields\FloatField('LATITUDE', ['scale' => 6]),
78 new Fields\FloatField('LONGITUDE', ['scale' => 6]),
79 new Fields\DatetimeField('TIMESTAMP_X', [
80 'default_value' => static fn() => new Main\Type\DateTime(),
81 ]),
82
83 (new Fields\IntegerField('TYPE'))
84 ->configureRequired(true),
85
86 // References
87
88 (new Relations\OneToMany('NAME', LocationNameTable::class, 'LOCATION'))
89 ->configureJoinType('left'),
90
91 (new Relations\OneToMany('ANCESTORS', HierarchyTable::class, 'ANCESTOR'))
92 ->configureJoinType('left'),
93
94 (new Relations\OneToMany('DESCENDANTS', HierarchyTable::class, 'DESCENDANT'))
95 ->configureJoinType('left'),
96
97 (new Relations\OneToMany('ADDRESSES', AddressTable::class, 'LOCATION'))
98 ->configureJoinType('left'),
99
100 (new Fields\Relations\OneToMany('FIELDS', LocationFieldTable::class, 'LOCATION'))
101 ->configureJoinType('left')
102 ];
103 }
104}
Определения collection.php:2