Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
baseprovider.php
1<?
3
4abstract class BaseProvider
5{
6 protected $options = [];
7
8 protected function __construct()
9 {
10 // You have to validate $options in a derived class constructor
11 }
12
13 public abstract function isAvailable(): bool;
14
20 public abstract function getItems(array $ids): array;
21
27 public function getPreselectedItems(array $ids): array
28 {
29 return $this->getSelectedItems($ids);
30 }
31
38 public function getSelectedItems(array $ids): array
39 {
40 return $this->getItems($ids);
41 }
42
43 public function getOptions(): array
44 {
45 return $this->options;
46 }
47
48 public function getOption(string $option, $defaultValue = null)
49 {
50 return array_key_exists($option, $this->options) ? $this->options[$option] : $defaultValue;
51 }
52
53 public function fillDialog(Dialog $dialog): void
54 {
55
56 }
57
58 public function getChildren(Item $parentItem, Dialog $dialog): void
59 {
60
61 }
62
63 public function doSearch(SearchQuery $searchQuery, Dialog $dialog): void
64 {
65
66 }
67
68 public function handleBeforeItemSave(Item $item): void
69 {
70
71 }
72}
getChildren(Item $parentItem, Dialog $dialog)
getOption(string $option, $defaultValue=null)
doSearch(SearchQuery $searchQuery, Dialog $dialog)