1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
registry.php
См. документацию.
1<?php
2
4
13
15{
16 use SingletonTrait;
17
18 private array $rules = [];
19
20 protected function __construct()
21 {
23 $this->registerRule(new PushDelayedRule());
27 }
28
34 public function registerRule(RouteRule $rule): self
35 {
36 $this->rules[] = $rule;
37
38 return $this;
39 }
40
48 public function registerRuleClass(string $className): self
49 {
50 if (class_exists($className))
51 {
52 $rule = new $className();
53 if ($rule instanceof RouteRule)
54 {
55 $this->registerRule($rule);
56 }
57 else
58 {
60 }
61 }
62 else
63 {
65 }
66
67 return $this;
68 }
69
73 public function getRules(): array
74 {
75 return $this->rules;
76 }
77}
static classIsNotRule(int $code=0, Throwable $previous=null)
Определения invalidruleexception.php:25
static classIsInvalid(int $code=0, Throwable $previous=null)
Определения invalidruleexception.php:14
registerRule(RouteRule $rule)
Определения registry.php:34
registerRuleClass(string $className)
Определения registry.php:48
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
trait SingletonTrait
Определения singletontrait.php:6