1 | <?php |
||
33 | class ProfileValidateComponent extends Component implements ValidateComponentInterface |
||
34 | { |
||
35 | /** |
||
36 | * Validate fields with rules. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | private $rules = []; |
||
41 | |||
42 | /** |
||
43 | * Attributes. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | private $attributes = []; |
||
48 | |||
49 | /** |
||
50 | * Attribute labels. |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | private $attributeLabels = []; |
||
55 | |||
56 | /** |
||
57 | * Set manage for roles. |
||
58 | * |
||
59 | * @var bool |
||
60 | */ |
||
61 | private $rbacManage = false; |
||
62 | |||
63 | /** |
||
64 | * Rewrite rules, labels, attributes by custom. |
||
65 | * |
||
66 | * @var bool |
||
67 | */ |
||
68 | private $customRewrite = false; |
||
69 | |||
70 | /** |
||
71 | * Form fields for the template. |
||
72 | * |
||
73 | * @var array |
||
74 | */ |
||
75 | private $formFields = []; |
||
76 | |||
77 | /** |
||
78 | * Form fields template. |
||
79 | * |
||
80 | * @var string|callable |
||
81 | */ |
||
82 | private $formTemplate = ''; |
||
83 | |||
84 | /** |
||
85 | * Columns for GridView widget in index template file. |
||
86 | * |
||
87 | * @var array |
||
88 | */ |
||
89 | private $indexViewColumns = []; |
||
90 | |||
91 | /** |
||
92 | * Attributes for DetailView widget in view template file. |
||
93 | * |
||
94 | * @var array |
||
95 | */ |
||
96 | private $detailViewAttributes = []; |
||
97 | |||
98 | /** |
||
99 | * Auth manager. |
||
100 | * |
||
101 | * @var ManagerInterface |
||
102 | */ |
||
103 | private $authManager; |
||
104 | |||
105 | /** |
||
106 | * Initialize. |
||
107 | */ |
||
108 | public function init() |
||
114 | |||
115 | /** |
||
116 | * Set validate fields with rules. |
||
117 | * |
||
118 | * @param array $rules |
||
119 | */ |
||
120 | public function setRules(array $rules): void |
||
124 | |||
125 | /** |
||
126 | * Get validate fields with rules. |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | public function getRules(): array |
||
134 | |||
135 | /** |
||
136 | * Set attributes. |
||
137 | * |
||
138 | * @param array $attributes |
||
139 | */ |
||
140 | public function setAttributes(array $attributes): void |
||
144 | |||
145 | /** |
||
146 | * Get attributes. |
||
147 | * |
||
148 | * @return array |
||
149 | */ |
||
150 | public function getAttributes(): array |
||
154 | |||
155 | /** |
||
156 | * Set attribute labels. |
||
157 | * |
||
158 | * @param array $attributeLabels |
||
159 | */ |
||
160 | public function setAttributeLabels(array $attributeLabels): void |
||
164 | |||
165 | /** |
||
166 | * Get attribute labels. |
||
167 | * |
||
168 | * @return array |
||
169 | */ |
||
170 | public function getAttributeLabels(): array |
||
174 | |||
175 | /** |
||
176 | * Set manage for roles. |
||
177 | * |
||
178 | * @param bool $rbacManage |
||
179 | */ |
||
180 | public function setRbacManage(bool $rbacManage): void |
||
184 | |||
185 | /** |
||
186 | * Is manage for roles. |
||
187 | * |
||
188 | * @return bool |
||
189 | */ |
||
190 | public function getRbacManage(): bool |
||
194 | |||
195 | /** |
||
196 | * Set rewrite rules, labels, attributes by custom. |
||
197 | * |
||
198 | * @param bool $customRewrite |
||
199 | */ |
||
200 | public function setCustomRewrite(bool $customRewrite): void |
||
204 | |||
205 | /** |
||
206 | * Get rewrite rules, labels, attributes by custom. |
||
207 | * |
||
208 | * @return bool |
||
209 | */ |
||
210 | public function getCustomRewrite(): bool |
||
214 | |||
215 | /** |
||
216 | * Set form fields for the template. |
||
217 | * |
||
218 | * @param array $formFields |
||
219 | */ |
||
220 | public function setFormFields(array $formFields): void |
||
224 | |||
225 | /** |
||
226 | * Get Form fields for the template. |
||
227 | * |
||
228 | * @return array |
||
229 | */ |
||
230 | public function getFormFields(): array |
||
234 | |||
235 | /** |
||
236 | * Set form fields template. |
||
237 | * |
||
238 | * @param string|callable $formTemplate |
||
239 | */ |
||
240 | public function setFormTemplate($formTemplate): void |
||
244 | |||
245 | /** |
||
246 | * Get form fields template. |
||
247 | * |
||
248 | * @return string|callable |
||
249 | */ |
||
250 | public function getFormTemplate() |
||
254 | |||
255 | /** |
||
256 | * Set columns for GridView widget in index template file. |
||
257 | * |
||
258 | * @param array $indexViewColumns |
||
259 | */ |
||
260 | public function setIndexViewColumns(array $indexViewColumns): void |
||
264 | |||
265 | /** |
||
266 | * Get columns for GridView widget in index template file. |
||
267 | * |
||
268 | * @return array |
||
269 | */ |
||
270 | public function getIndexViewColumns(): array |
||
274 | |||
275 | /** |
||
276 | * Set attributes for DetailView widget in view template file. |
||
277 | * |
||
278 | * @param array $detailViewAttributes |
||
279 | */ |
||
280 | public function setDetailViewAttributes(array $detailViewAttributes): void |
||
284 | |||
285 | /** |
||
286 | * Get attributes for DetailView widget in view template file. |
||
287 | * |
||
288 | * @return array |
||
289 | */ |
||
290 | public function getDetailViewAttributes(): array |
||
294 | |||
295 | /** |
||
296 | * Set authManager (RBAC). |
||
297 | * |
||
298 | * @param ManagerInterface $authManager |
||
299 | */ |
||
300 | public function setAuthManager(ManagerInterface $authManager): void |
||
304 | |||
305 | /** |
||
306 | * Get authManager (RBAC). |
||
307 | * |
||
308 | * @return ManagerInterface |
||
309 | */ |
||
310 | public function getAuthManager(): ManagerInterface |
||
314 | |||
315 | /** |
||
316 | * Set a user model for ProfileValidateComponent validation model. |
||
317 | * |
||
318 | * @param $model |
||
319 | * |
||
320 | * @throws InvalidConfigException |
||
321 | * |
||
322 | * @return ModelInterface |
||
323 | */ |
||
324 | public function setModel($model): ModelInterface |
||
342 | } |
||
343 |