1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
geonametable.php
См. документацию.
1<?php
2
9
11
14
32{
33 use Data\Internal\MergeTrait;
34
35 public static function getTableName()
36 {
37 return 'b_geoname';
38 }
39
40 public static function getMap()
41 {
42 return [
43 (new Fields\IntegerField('ID'))
44 ->configurePrimary(),
45 (new Fields\StringField('LANGUAGE_CODE'))
46 ->configurePrimary(),
47 (new Fields\StringField('NAME')),
48 ];
49 }
50
51 public static function save(array $data): void
52 {
53 $existing = static::get(array_keys($data));
54
55 foreach ($data as $geoid => $names)
56 {
57 if (is_array($names))
58 {
59 foreach ($names as $lang => $name)
60 {
61 if (!isset($existing[$geoid][$lang]) || $existing[$geoid][$lang] != $name)
62 {
63 $insert = [
64 'ID' => $geoid,
65 'LANGUAGE_CODE' => $lang,
66 'NAME' => $name,
67 ];
68 $update = [
69 'NAME' => $name,
70 ];
71 static::merge($insert, $update);
72 }
73 }
74 }
75 }
76 }
77
78 public static function get(array $ids): array
79 {
80 $existing = [];
81
82 if (!empty($ids))
83 {
84 $query = static::query()
85 ->setSelect(['*'])
86 ->whereIn('ID', $ids)
87 ->exec()
88 ;
89
90 while ($record = $query->fetch())
91 {
92 $existing[$record['ID']][$record['LANGUAGE_CODE']] = $record['NAME'];
93 }
94 }
95
96 return $existing;
97 }
98}
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$query
Определения get_search.php:11
if(!defined('SITE_ID')) $lang
Определения include.php:91
$name
Определения menu_edit.php:35