Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
locationfieldtable.php
1<?php
2
4
8
26{
32 public static function getTableName()
33 {
34 return 'b_location_field';
35 }
36
42 public static function getMap()
43 {
44 return [
45
46 (new Fields\IntegerField('LOCATION_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, 255)),
56
57 // Ref
58
59 (new Fields\Relations\Reference('LOCATION', LocationTable::class,
60 Join::on('this.LOCATION_ID', 'ref.ID')))
61 ->configureJoinType('inner')
62 ];
63 }
64
65 public static function deleteByLocationId(int $locationId)
66 {
67 Main\Application::getConnection()->queryExecute("
68 DELETE
69 FROM ".self::getTableName()."
70 WHERE
71 LOCATION_ID=".(int)$locationId
72 );
73 }
74}