Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
locationtable.php
1<?php
3
9
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\DateField('TIMESTAMP_X'),
80
81 (new Fields\IntegerField('TYPE'))
82 ->configureRequired(true),
83
84 // References
85
86 (new Relations\OneToMany('NAME', LocationNameTable::class, 'LOCATION'))
87 ->configureJoinType('left'),
88
89 (new Relations\OneToMany('ANCESTORS', HierarchyTable::class, 'ANCESTOR'))
90 ->configureJoinType('left'),
91
92 (new Relations\OneToMany('DESCENDANTS', HierarchyTable::class, 'DESCENDANT'))
93 ->configureJoinType('left'),
94
95 (new Relations\OneToMany('ADDRESSES', AddressTable::class, 'LOCATION'))
96 ->configureJoinType('left'),
97
98 (new Fields\Relations\OneToMany('FIELDS', LocationFieldTable::class, 'LOCATION'))
99 ->configureJoinType('left')
100 ];
101 }
102}