Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
base.php
1<?php
9
12
13Loc::loadMessages(__FILE__);
14
19class Base
20{
22 protected $checkers = array();
23
25 protected $responseModifiers = array();
26
34 public function addChecker($checker)
35 {
36 if (!is_callable($checker))
37 {
38 throw new ArgumentException("Argument 'checker' should be callable.");
39 }
40
41 $this->checkers[] = $checker;
42 return $this;
43 }
50 public function setCheckers(array $checkers)
51 {
52 foreach ($checkers as $checker)
53 {
54 $this->addChecker($checker);
55 }
56
57 return $this;
58 }
59
67 public function addResponseModifier($modifier)
68 {
69 if (!is_callable($modifier))
70 {
71 throw new ArgumentException("Argument 'modifier' should be callable.");
72 }
73
74 $this->responseModifiers[] = $modifier;
75 return $this;
76 }
77
84 public function setResponseModifiers(array $modifiers)
85 {
86 foreach ($modifiers as $modifier)
87 {
88 $this->addResponseModifier($modifier);
89 }
90
91 return $this;
92 }
93
99 public function getCheckers()
100 {
101 return $this->checkers;
102 }
103
109 public function getResponseModifiers()
110 {
112 }
113
122 public static function call($callee, array $parameters = array())
123 {
124 if (!is_callable($callee))
125 {
126 throw new ArgumentException("Argument 'callee' should be callable.");
127 }
128
129 return call_user_func_array($callee, $parameters);
130 }
131}
static loadMessages($file)
Definition loc.php:64
static call($callee, array $parameters=array())
Definition base.php:122