Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
addressfieldtable.php
1<?php
2
4
8
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}