1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
FieldFactory.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Chat\Fields;
4
5use Bitrix\Im\V2\Chat\Fields\Field\Background;
6use Bitrix\Im\V2\Chat\Fields\Field\TextFieldEnabled;
7
9{
10 private static ?self $instance = null;
11
12 private function __construct()
13 {}
14
15 public static function getInstance(): self
16 {
17 return self::$instance ?? new self();
18 }
19
20 public function getField(Field $field, int $chatId): BaseField
21 {
22 return match ($field)
23 {
24 Field::TextFieldEnabled => (new TextFieldEnabled($chatId)),
25 Field::BackgroundId => (new Background($chatId))
26 };
27 }
28}
getField(Field $field, int $chatId)
Определения FieldFactory.php:20