1 | <?php |
||
34 | class Combo extends Widget |
||
35 | { |
||
36 | /** |
||
37 | * @var Model |
||
38 | */ |
||
39 | public $model; |
||
40 | |||
41 | /** |
||
42 | * @var string the attribute name |
||
43 | */ |
||
44 | public $attribute; |
||
45 | |||
46 | /** |
||
47 | * @var array the url that will be passed to [[Url::to()]] method to create the request URL |
||
48 | */ |
||
49 | public $url; |
||
50 | |||
51 | /** |
||
52 | * @var string the type of the field. |
||
53 | * Usual should be module/comboName. |
||
54 | * For example: client/client, hosting/account, domain/domain. |
||
55 | * In case of the combo overriding with some specific filters, |
||
56 | * the type should represent the filter. |
||
57 | * For example: if the hosting/service combo is extended with filter |
||
58 | * to show only DB services, the type should be hosting/service/db or hosting/dbService. |
||
59 | * The decision of the style depends on overall code style and readability |
||
60 | */ |
||
61 | public $type; |
||
62 | |||
63 | /** |
||
64 | * @var string the name of the representative field in the model. |
||
65 | * Used by [[getPrimaryFilter]] to create the name of the filtering field |
||
66 | * @see getPrimaryFilter() |
||
67 | */ |
||
68 | public $name; |
||
69 | |||
70 | /** |
||
71 | * @var string md5 of the configuration. |
||
72 | * Appears only after the combo registration in [[register]] |
||
73 | * @see register() |
||
74 | */ |
||
75 | public $configId; |
||
76 | |||
77 | /** |
||
78 | * @var array the HTML options for the input element |
||
79 | */ |
||
80 | public $inputOptions = []; |
||
81 | |||
82 | /** |
||
83 | * @var string the outer element selector, that holds all of related Combos |
||
84 | */ |
||
85 | public $formElementSelector = 'form'; |
||
86 | |||
87 | /** |
||
88 | * @var string the language. Default is application language |
||
89 | */ |
||
90 | public $language; |
||
91 | |||
92 | /** |
||
93 | * @var bool allow multiple selection |
||
94 | */ |
||
95 | public $multiple; |
||
96 | |||
97 | /** |
||
98 | * @var mixed returning arguments |
||
99 | * Example: |
||
100 | * |
||
101 | * ``` |
||
102 | * ['id', 'password', 'another_column'] |
||
103 | * ``` |
||
104 | * |
||
105 | * @see getReturn() |
||
106 | * @see setReturn() |
||
107 | */ |
||
108 | protected $_return; |
||
109 | |||
110 | /** |
||
111 | * @var array renamed arguments |
||
112 | * Example: |
||
113 | * |
||
114 | * ``` |
||
115 | * [ |
||
116 | * 'new_col_name' => 'old_col_name', |
||
117 | * 'text' => 'login', |
||
118 | * 'deep' => 'array.subarray.value' // can extract some value from an array |
||
119 | * ] |
||
120 | * ``` |
||
121 | * |
||
122 | * @see getName() |
||
123 | * @see setName() |
||
124 | */ |
||
125 | protected $_rename; |
||
126 | |||
127 | /** |
||
128 | * @var array the static filters |
||
129 | * Example: |
||
130 | * |
||
131 | * ``` |
||
132 | * [ |
||
133 | * 'someStaticValue' => ['format' => 'the_value'], |
||
134 | * 'type' => ['format' => 'seller'], |
||
135 | * 'is_active' => [ |
||
136 | * 'field' => 'server', |
||
137 | * 'format' => new JsExpression('function (id, text, field) { |
||
138 | * if (field.isSet()) { |
||
139 | * return 1; |
||
140 | * } |
||
141 | * }'), |
||
142 | * ] |
||
143 | * ] |
||
144 | * @see setFilter() |
||
145 | * @see getFilter() |
||
146 | */ |
||
147 | protected $_filter = []; |
||
148 | |||
149 | /** |
||
150 | * @var string the name of the primary filter. Default: [[name]]_like |
||
151 | * @see getPrimaryFilter |
||
152 | * @see setPrimaryFilter |
||
153 | */ |
||
154 | protected $_primaryFilter; |
||
155 | |||
156 | /** |
||
157 | * @var boolean|string whether the combo has a primary key |
||
158 | * true (default) - the combo has an id in field id |
||
159 | * false - the combo does not have an id. The value is equal to the id |
||
160 | * some string - the name of the id field |
||
161 | */ |
||
162 | public $_hasId; |
||
163 | |||
164 | /** |
||
165 | * Options that will be passed to the plugin. |
||
166 | * |
||
167 | * @var array |
||
168 | * @see getPluginOptions() |
||
169 | */ |
||
170 | public $_pluginOptions = []; |
||
171 | |||
172 | /** {@inheritdoc} */ |
||
173 | 2 | public function init() |
|
194 | |||
195 | public function run() |
||
201 | |||
202 | /** |
||
203 | * Renders text input that will be used by the plugin. |
||
204 | * Must apply [[inputOptions]] to the HTML element. |
||
205 | * |
||
206 | * @return string |
||
207 | */ |
||
208 | protected function renderInput() |
||
212 | |||
213 | public function registerClientConfig() |
||
223 | |||
224 | public function registerClientScript() |
||
232 | |||
233 | public function getReturn() |
||
237 | |||
238 | /** |
||
239 | * @return mixed |
||
240 | */ |
||
241 | 2 | public function getRename() |
|
245 | |||
246 | /** |
||
247 | * @return mixed |
||
248 | */ |
||
249 | public function getFilter() |
||
253 | |||
254 | /** |
||
255 | * @param mixed $filter |
||
256 | */ |
||
257 | public function setFilter($filter) |
||
261 | |||
262 | /** |
||
263 | * @param mixed $rename |
||
264 | */ |
||
265 | 2 | public function setRename($rename) |
|
269 | |||
270 | /** |
||
271 | * @param mixed $return |
||
272 | */ |
||
273 | 2 | public function setReturn($return) |
|
277 | |||
278 | /** |
||
279 | * @return string |
||
280 | * @see _primaryFilter |
||
281 | */ |
||
282 | public function getPrimaryFilter() |
||
286 | |||
287 | /** |
||
288 | * @param $primaryFilter |
||
289 | * @see _primaryFilter |
||
290 | */ |
||
291 | public function setPrimaryFilter($primaryFilter) |
||
295 | |||
296 | /** |
||
297 | * Returns the config of the Combo, merges with the passed $config. |
||
298 | * |
||
299 | * @param array $options |
||
300 | * @return array |
||
301 | */ |
||
302 | public function getPluginOptions($options = []) |
||
335 | |||
336 | public function getFormIsBulk() |
||
340 | |||
341 | /** |
||
342 | * @param array $pluginOptions |
||
343 | */ |
||
344 | public function setPluginOptions($pluginOptions) |
||
348 | |||
349 | /** |
||
350 | * @return bool|string |
||
351 | */ |
||
352 | public function getHasId() |
||
356 | |||
357 | /** |
||
358 | * @param bool|string $hasId |
||
359 | */ |
||
360 | public function setHasId($hasId) |
||
364 | } |
||
365 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..