Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
FriendlyPropertyProvider.php
1<?php
2
4
6
8{
9 public const FEATURE_PUBLIC_PROPERTY = 'IS_PUBLIC';
10
11 public function getEntityFields(): array
12 {
13 $fields = parent::getEntityFields();
14 $fields[] = [
16 'title' => Loc::getMessage('IBLOCK_ENTITY_EDITOR_FRIENDLY_PROPERTY_FEATURE_PUBLIC'),
17 'type' => 'boolean',
18 'default_value' => 'Y',
19 ];
20 $fields = $this->removeDifficultFields($fields);
21
22 return $fields;
23 }
24
25 public function getAdditionalFields(): array
26 {
27 $fields = parent::getAdditionalFields();
28 $fields = $this->removeDifficultFields($fields);
29
30 return $fields;
31 }
32
33 private function removeDifficultFields(array $fields): array
34 {
35 $names = array_fill_keys([
36 'WITH_DESCRIPTION',
37 'COL_COUNT',
38 'ROW_COUNT',
39 'MULTIPLE_CNT',
40 'SECTION_PROPERTY',
41 'FEATURES[iblock:LIST_PAGE_SHOW]',
42 'FEATURES[iblock:DETAIL_PAGE_SHOW]',
43 ], true);
44
45 return array_filter($fields, static fn(array $field) => !isset($names[$field['name']]));
46 }
47}
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29