1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
CatalogFilterFactory.php
См. документацию.
1<?php
2
4
11
13{
14 private array $actionToFilterClassMap;
15
16 private static function getMap(): array
17 {
18 return [
19 StoreDocumentFilter::class => [
26 ],
27 StoreViewFilter::class => [
30 ],
31 ];
32 }
33
34 private function getFilterClassByAction(string $action): ?string
35 {
36 if (!isset($this->actionToFilterClassMap))
37 {
38 $this->actionToFilterClassMap = [];
39
40 foreach (self::getMap() as $filterClass => $itemActionNames)
41 {
42 foreach ($itemActionNames as $itemAction)
43 {
44 $this->actionToFilterClassMap[$itemAction] = $filterClass;
45 }
46 }
47 }
48
49 return $this->actionToFilterClassMap[$action] ?? null;
50 }
51
52 public function createFromAction(string $action, AccessibleController $controller): ?AccessFilter
53 {
54 $filterClassName = $this->getFilterClassByAction($action);
55 if (!$filterClassName)
56 {
57 return null;
58 }
59
60 return new $filterClassName($controller);
61 }
62}
createFromAction(string $action, AccessibleController $controller)
Определения CatalogFilterFactory.php:52
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$action
Определения file_dialog.php:21