Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
locationnametable.php
1<?php
3
9
28{
34 public static function getTableName()
35 {
36 return 'b_location_name';
37 }
38
44 public static function getMap()
45 {
46 return [
47 (new Fields\IntegerField('LOCATION_ID'))
48 ->configurePrimary(true)
49 ->configureRequired(true),
50
51 (new Fields\StringField('LANGUAGE_ID'))
52 ->configurePrimary(true)
53 ->configureRequired(true)
54 ->addValidator(new Main\ORM\Fields\Validators\LengthValidator(2, 2)),
55
56 (new Fields\StringField('NAME'))
57 ->configureRequired(true)
58 ->addValidator(new Main\ORM\Fields\Validators\LengthValidator(1, 1000)),
59
60 (new Fields\StringField('NAME_NORMALIZED'))
61 ->addValidator(new Main\ORM\Fields\Validators\LengthValidator(null, 1000)),
62
63 // Ref
64
65 (new Reference('LOCATION', LocationTable::class,
66 Join::on('this.LOCATION_ID', 'ref.ID')))
67 ->configureJoinType('inner')
68 ];
69 }
70
75 public static function deleteByLocationId(int $locationId)
76 {
77 Application::getConnection()->queryExecute("
78 DELETE
79 FROM ".self::getTableName()."
80 WHERE LOCATION_ID=".(int)$locationId
81 );
82 }
83}
static getConnection($name="")