Commit | Line | Data |
---|---|---|
45ca63d0 TD |
1 | |
2 | <!doctype html> | |
3 | <html lang="en" class="no-js"> | |
4 | <head> | |
5 | ||
6 | <meta charset="utf-8"> | |
7 | <meta name="viewport" content="width=device-width,initial-scale=1"> | |
8 | ||
9 | ||
10 | ||
11 | ||
fb962f09 WG |
12 | <link rel="icon" href="../../assets/default.favicon.ico"> |
13 | <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.1.0"> | |
45ca63d0 TD |
14 | |
15 | ||
16 | ||
17 | <title>Database Objects - WoltLab Suite Documentation</title> | |
18 | ||
19 | ||
20 | ||
fb962f09 | 21 | <link rel="stylesheet" href="../../assets/stylesheets/main.33e2939f.min.css"> |
45ca63d0 TD |
22 | |
23 | ||
fb962f09 | 24 | <link rel="stylesheet" href="../../assets/stylesheets/palette.ef6f36e2.min.css"> |
45ca63d0 TD |
25 | |
26 | ||
27 | ||
28 | <meta name="theme-color" content="#009485"> | |
29 | ||
30 | ||
31 | ||
32 | ||
33 | ||
fd8430cb WG |
34 | |
35 | ||
45ca63d0 TD |
36 | |
37 | ||
38 | <link rel="stylesheet" href="../../stylesheets/extra.css"> | |
39 | ||
40 | ||
41 | ||
42 | ||
43 | ||
44 | </head> | |
45 | ||
46 | ||
47 | ||
48 | ||
49 | ||
50 | ||
51 | ||
52 | <body dir="ltr" data-md-color-scheme="" data-md-color-primary="teal" data-md-color-accent=""> | |
45ca63d0 TD |
53 | |
54 | ||
fb962f09 WG |
55 | <script>function __prefix(e){return new URL("../..",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script> |
56 | ||
45ca63d0 TD |
57 | <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off"> |
58 | <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off"> | |
59 | <label class="md-overlay" for="__drawer"></label> | |
60 | <div data-md-component="skip"> | |
61 | ||
62 | ||
63 | <a href="#database-objects" class="md-skip"> | |
64 | Skip to content | |
65 | </a> | |
66 | ||
67 | </div> | |
68 | <div data-md-component="announce"> | |
69 | ||
70 | <aside class="md-announce"> | |
71 | <div class="md-announce__inner md-grid md-typeset"> | |
72 | ||
73 | <a href="https://www.woltlab.com">Back to <strong>woltlab.com</strong></a> | |
74 | ||
75 | </div> | |
76 | </aside> | |
77 | ||
78 | </div> | |
79 | ||
fb962f09 | 80 | <header class="md-header" data-md-component="header"> |
45ca63d0 | 81 | <nav class="md-header__inner md-grid" aria-label="Header"> |
fb962f09 | 82 | <a href="../.." title="WoltLab Suite Documentation" class="md-header__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo"> |
45ca63d0 TD |
83 | |
84 | <img src="../../assets/logo.png" alt="logo"> | |
85 | ||
86 | </a> | |
87 | <label class="md-header__button md-icon" for="__drawer"> | |
88 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg> | |
89 | </label> | |
90 | <div class="md-header__title" data-md-component="header-title"> | |
91 | <div class="md-header__ellipsis"> | |
92 | <div class="md-header__topic"> | |
93 | <span class="md-ellipsis"> | |
94 | WoltLab Suite Documentation | |
95 | </span> | |
96 | </div> | |
97 | <div class="md-header__topic" data-md-component="header-topic"> | |
98 | <span class="md-ellipsis"> | |
99 | ||
100 | Database Objects | |
101 | ||
102 | </span> | |
103 | </div> | |
104 | </div> | |
45ca63d0 TD |
105 | </div> |
106 | ||
fb962f09 WG |
107 | |
108 | ||
a3639e76 WG |
109 | <label class="md-header__button md-icon" for="__search"> |
110 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg> | |
111 | </label> | |
112 | ||
113 | <div class="md-search" data-md-component="search" role="dialog"> | |
114 | <label class="md-search__overlay" for="__search"></label> | |
115 | <div class="md-search__inner" role="search"> | |
116 | <form class="md-search__form" name="search"> | |
117 | <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required> | |
118 | <label class="md-search__icon md-icon" for="__search"> | |
119 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg> | |
120 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg> | |
121 | </label> | |
122 | <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1"> | |
fb962f09 | 123 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg> |
a3639e76 WG |
124 | </button> |
125 | </form> | |
126 | <div class="md-search__output"> | |
127 | <div class="md-search__scrollwrap" data-md-scrollfix> | |
128 | <div class="md-search-result" data-md-component="search-result"> | |
129 | <div class="md-search-result__meta"> | |
130 | Initializing search | |
131 | </div> | |
132 | <ol class="md-search-result__list"></ol> | |
133 | </div> | |
134 | </div> | |
135 | </div> | |
136 | </div> | |
137 | </div> | |
138 | ||
45ca63d0 | 139 | |
7124f4cb WG |
140 | <div class="md-header__source"> |
141 | ||
142 | <a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source"> | |
143 | <div class="md-source__icon md-icon"> | |
144 | ||
fb962f09 | 145 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg> |
7124f4cb WG |
146 | </div> |
147 | <div class="md-source__repository"> | |
148 | GitHub | |
149 | </div> | |
150 | </a> | |
151 | </div> | |
152 | ||
45ca63d0 TD |
153 | </nav> |
154 | </header> | |
155 | ||
156 | <div class="md-container" data-md-component="container"> | |
157 | ||
158 | ||
159 | ||
160 | ||
161 | <main class="md-main" data-md-component="main"> | |
162 | <div class="md-main__inner md-grid"> | |
163 | ||
164 | ||
165 | ||
166 | <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" > | |
167 | <div class="md-sidebar__scrollwrap"> | |
168 | <div class="md-sidebar__inner"> | |
169 | ||
170 | ||
171 | ||
45ca63d0 TD |
172 | <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0"> |
173 | <label class="md-nav__title" for="__drawer"> | |
fb962f09 | 174 | <a href="../.." title="WoltLab Suite Documentation" class="md-nav__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo"> |
45ca63d0 TD |
175 | |
176 | <img src="../../assets/logo.png" alt="logo"> | |
177 | ||
178 | </a> | |
179 | WoltLab Suite Documentation | |
180 | </label> | |
181 | ||
7124f4cb WG |
182 | <div class="md-nav__source"> |
183 | ||
184 | <a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source"> | |
185 | <div class="md-source__icon md-icon"> | |
186 | ||
fb962f09 | 187 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg> |
7124f4cb WG |
188 | </div> |
189 | <div class="md-source__repository"> | |
190 | GitHub | |
191 | </div> | |
192 | </a> | |
193 | </div> | |
194 | ||
45ca63d0 TD |
195 | <ul class="md-nav__list" data-md-scrollfix> |
196 | ||
197 | ||
198 | ||
199 | ||
200 | ||
201 | ||
202 | ||
203 | ||
204 | <li class="md-nav__item"> | |
205 | <a href="../../getting-started/" class="md-nav__link"> | |
206 | Getting Started | |
207 | </a> | |
208 | </li> | |
209 | ||
210 | ||
211 | ||
212 | ||
213 | ||
214 | ||
215 | ||
216 | ||
217 | ||
218 | ||
219 | ||
220 | ||
221 | ||
222 | <li class="md-nav__item md-nav__item--active md-nav__item--nested"> | |
223 | ||
224 | ||
225 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2" type="checkbox" id="__nav_2" checked> | |
226 | ||
227 | <label class="md-nav__link" for="__nav_2"> | |
228 | PHP API | |
229 | <span class="md-nav__icon md-icon"></span> | |
230 | </label> | |
231 | <nav class="md-nav" aria-label="PHP API" data-md-level="1"> | |
232 | <label class="md-nav__title" for="__nav_2"> | |
233 | <span class="md-nav__icon md-icon"></span> | |
234 | PHP API | |
235 | </label> | |
236 | <ul class="md-nav__list" data-md-scrollfix> | |
237 | ||
238 | ||
239 | ||
240 | ||
241 | ||
242 | <li class="md-nav__item"> | |
243 | <a href="../pages/" class="md-nav__link"> | |
244 | Pages | |
245 | </a> | |
246 | </li> | |
247 | ||
248 | ||
249 | ||
250 | ||
251 | ||
252 | ||
253 | ||
254 | ||
255 | ||
256 | <li class="md-nav__item md-nav__item--active"> | |
257 | ||
258 | <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc"> | |
259 | ||
260 | ||
261 | ||
262 | ||
263 | <label class="md-nav__link md-nav__link--active" for="__toc"> | |
264 | Database Objects | |
265 | <span class="md-nav__icon md-icon"></span> | |
266 | </label> | |
267 | ||
268 | <a href="./" class="md-nav__link md-nav__link--active"> | |
269 | Database Objects | |
270 | </a> | |
271 | ||
272 | ||
273 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents"> | |
274 | ||
275 | ||
276 | ||
277 | ||
278 | ||
279 | <label class="md-nav__title" for="__toc"> | |
280 | <span class="md-nav__icon md-icon"></span> | |
281 | Table of contents | |
282 | </label> | |
283 | <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> | |
284 | ||
285 | <li class="md-nav__item"> | |
286 | <a href="#databaseobject" class="md-nav__link"> | |
287 | DatabaseObject | |
288 | </a> | |
289 | ||
290 | </li> | |
291 | ||
292 | <li class="md-nav__item"> | |
293 | <a href="#databaseobjectdecorator" class="md-nav__link"> | |
294 | DatabaseObjectDecorator | |
295 | </a> | |
296 | ||
297 | </li> | |
298 | ||
299 | <li class="md-nav__item"> | |
300 | <a href="#databaseobjecteditor" class="md-nav__link"> | |
301 | DatabaseObjectEditor | |
302 | </a> | |
303 | ||
304 | <nav class="md-nav" aria-label="DatabaseObjectEditor"> | |
305 | <ul class="md-nav__list"> | |
306 | ||
307 | <li class="md-nav__item"> | |
308 | <a href="#create-a-new-row" class="md-nav__link"> | |
309 | Create a new row | |
310 | </a> | |
311 | ||
312 | </li> | |
313 | ||
314 | <li class="md-nav__item"> | |
315 | <a href="#updating-an-existing-row" class="md-nav__link"> | |
316 | Updating an existing row | |
317 | </a> | |
318 | ||
319 | </li> | |
320 | ||
321 | <li class="md-nav__item"> | |
322 | <a href="#deleting-a-row" class="md-nav__link"> | |
323 | Deleting a row | |
324 | </a> | |
325 | ||
326 | </li> | |
327 | ||
328 | </ul> | |
329 | </nav> | |
330 | ||
331 | </li> | |
332 | ||
333 | <li class="md-nav__item"> | |
334 | <a href="#databaseobjectlist" class="md-nav__link"> | |
335 | DatabaseObjectList | |
336 | </a> | |
337 | ||
338 | </li> | |
339 | ||
340 | <li class="md-nav__item"> | |
341 | <a href="#abstractdatabaseobjectaction" class="md-nav__link"> | |
342 | AbstractDatabaseObjectAction | |
343 | </a> | |
344 | ||
345 | <nav class="md-nav" aria-label="AbstractDatabaseObjectAction"> | |
346 | <ul class="md-nav__list"> | |
347 | ||
348 | <li class="md-nav__item"> | |
349 | <a href="#executing-an-action" class="md-nav__link"> | |
350 | Executing an Action | |
351 | </a> | |
352 | ||
353 | </li> | |
354 | ||
355 | <li class="md-nav__item"> | |
356 | <a href="#custom-method-with-ajax-support" class="md-nav__link"> | |
357 | Custom Method with AJAX Support | |
358 | </a> | |
359 | ||
360 | <nav class="md-nav" aria-label="Custom Method with AJAX Support"> | |
361 | <ul class="md-nav__list"> | |
362 | ||
363 | <li class="md-nav__item"> | |
364 | <a href="#ajax-validation" class="md-nav__link"> | |
365 | AJAX Validation | |
366 | </a> | |
367 | ||
368 | </li> | |
369 | ||
370 | <li class="md-nav__item"> | |
371 | <a href="#create-update-and-delete" class="md-nav__link"> | |
372 | create, update and delete | |
373 | </a> | |
374 | ||
375 | </li> | |
376 | ||
377 | <li class="md-nav__item"> | |
378 | <a href="#allow-invokation-by-guests" class="md-nav__link"> | |
379 | Allow Invokation by Guests | |
380 | </a> | |
381 | ||
382 | </li> | |
383 | ||
384 | <li class="md-nav__item"> | |
385 | <a href="#acp-access-only" class="md-nav__link"> | |
386 | ACP Access Only | |
387 | </a> | |
388 | ||
389 | </li> | |
390 | ||
391 | </ul> | |
392 | </nav> | |
393 | ||
394 | </li> | |
395 | ||
396 | </ul> | |
397 | </nav> | |
398 | ||
399 | </li> | |
400 | ||
401 | </ul> | |
402 | ||
403 | </nav> | |
404 | ||
405 | </li> | |
406 | ||
407 | ||
408 | ||
409 | ||
410 | ||
411 | ||
412 | ||
413 | <li class="md-nav__item"> | |
414 | <a href="../database-access/" class="md-nav__link"> | |
415 | Database Access | |
416 | </a> | |
417 | </li> | |
418 | ||
419 | ||
420 | ||
421 | ||
422 | ||
423 | ||
424 | ||
425 | <li class="md-nav__item"> | |
426 | <a href="../exceptions/" class="md-nav__link"> | |
427 | Exceptions | |
428 | </a> | |
429 | </li> | |
430 | ||
431 | ||
432 | ||
433 | ||
434 | ||
435 | ||
436 | ||
437 | ||
438 | <li class="md-nav__item md-nav__item--nested"> | |
439 | ||
440 | ||
441 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5" type="checkbox" id="__nav_2_5" > | |
442 | ||
443 | <label class="md-nav__link" for="__nav_2_5"> | |
444 | API | |
445 | <span class="md-nav__icon md-icon"></span> | |
446 | </label> | |
447 | <nav class="md-nav" aria-label="API" data-md-level="2"> | |
448 | <label class="md-nav__title" for="__nav_2_5"> | |
449 | <span class="md-nav__icon md-icon"></span> | |
450 | API | |
451 | </label> | |
452 | <ul class="md-nav__list" data-md-scrollfix> | |
453 | ||
454 | ||
455 | ||
456 | ||
457 | ||
458 | <li class="md-nav__item"> | |
459 | <a href="../api/caches/" class="md-nav__link"> | |
460 | Caches | |
461 | </a> | |
462 | </li> | |
463 | ||
464 | ||
465 | ||
466 | ||
467 | ||
468 | ||
469 | ||
470 | <li class="md-nav__item"> | |
471 | <a href="../api/comments/" class="md-nav__link"> | |
472 | Comments | |
473 | </a> | |
474 | </li> | |
475 | ||
476 | ||
477 | ||
478 | ||
479 | ||
480 | ||
481 | ||
482 | <li class="md-nav__item"> | |
483 | <a href="../api/cronjobs/" class="md-nav__link"> | |
484 | Cronjobs | |
485 | </a> | |
486 | </li> | |
487 | ||
488 | ||
489 | ||
490 | ||
491 | ||
492 | ||
493 | ||
494 | <li class="md-nav__item"> | |
495 | <a href="../api/events/" class="md-nav__link"> | |
496 | Events | |
497 | </a> | |
498 | </li> | |
499 | ||
500 | ||
501 | ||
502 | ||
503 | ||
504 | ||
505 | ||
506 | ||
507 | <li class="md-nav__item md-nav__item--nested"> | |
508 | ||
509 | ||
510 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5_5" type="checkbox" id="__nav_2_5_5" > | |
511 | ||
512 | <label class="md-nav__link" for="__nav_2_5_5"> | |
513 | Form Builder | |
514 | <span class="md-nav__icon md-icon"></span> | |
515 | </label> | |
516 | <nav class="md-nav" aria-label="Form Builder" data-md-level="3"> | |
517 | <label class="md-nav__title" for="__nav_2_5_5"> | |
518 | <span class="md-nav__icon md-icon"></span> | |
519 | Form Builder | |
520 | </label> | |
521 | <ul class="md-nav__list" data-md-scrollfix> | |
522 | ||
523 | ||
524 | ||
525 | ||
526 | ||
527 | <li class="md-nav__item"> | |
528 | <a href="../api/form_builder/overview/" class="md-nav__link"> | |
529 | Overview | |
530 | </a> | |
531 | </li> | |
532 | ||
533 | ||
534 | ||
535 | ||
536 | ||
537 | ||
538 | ||
539 | <li class="md-nav__item"> | |
540 | <a href="../api/form_builder/structure/" class="md-nav__link"> | |
541 | Structure | |
542 | </a> | |
543 | </li> | |
544 | ||
545 | ||
546 | ||
547 | ||
548 | ||
549 | ||
550 | ||
551 | <li class="md-nav__item"> | |
552 | <a href="../api/form_builder/form_fields/" class="md-nav__link"> | |
553 | Fields | |
554 | </a> | |
555 | </li> | |
556 | ||
557 | ||
558 | ||
559 | ||
560 | ||
561 | ||
562 | ||
563 | <li class="md-nav__item"> | |
564 | <a href="../api/form_builder/validation_data/" class="md-nav__link"> | |
565 | Validation and Data | |
566 | </a> | |
567 | </li> | |
568 | ||
569 | ||
570 | ||
571 | ||
572 | ||
573 | ||
574 | ||
575 | <li class="md-nav__item"> | |
576 | <a href="../api/form_builder/dependencies/" class="md-nav__link"> | |
577 | Dependencies | |
578 | </a> | |
579 | </li> | |
580 | ||
581 | ||
582 | ||
583 | </ul> | |
584 | </nav> | |
585 | </li> | |
586 | ||
587 | ||
588 | ||
589 | ||
590 | ||
591 | ||
592 | ||
593 | <li class="md-nav__item"> | |
594 | <a href="../api/package_installation_plugins/" class="md-nav__link"> | |
595 | Package Installation Plugins | |
596 | </a> | |
597 | </li> | |
598 | ||
599 | ||
600 | ||
601 | ||
602 | ||
603 | ||
604 | ||
605 | <li class="md-nav__item"> | |
606 | <a href="../api/user_activity_points/" class="md-nav__link"> | |
607 | User Activity Points | |
608 | </a> | |
609 | </li> | |
610 | ||
611 | ||
612 | ||
613 | ||
614 | ||
615 | ||
616 | ||
617 | <li class="md-nav__item"> | |
618 | <a href="../api/user_notifications/" class="md-nav__link"> | |
619 | User Notifications | |
620 | </a> | |
621 | </li> | |
622 | ||
623 | ||
624 | ||
625 | ||
626 | ||
627 | ||
628 | ||
629 | <li class="md-nav__item"> | |
630 | <a href="../api/sitemaps/" class="md-nav__link"> | |
631 | Sitemaps | |
632 | </a> | |
633 | </li> | |
634 | ||
635 | ||
636 | ||
637 | </ul> | |
638 | </nav> | |
639 | </li> | |
640 | ||
641 | ||
642 | ||
643 | ||
644 | ||
645 | ||
646 | ||
647 | <li class="md-nav__item"> | |
648 | <a href="../code-style/" class="md-nav__link"> | |
649 | Code Style | |
650 | </a> | |
651 | </li> | |
652 | ||
653 | ||
654 | ||
655 | ||
656 | ||
657 | ||
658 | ||
659 | <li class="md-nav__item"> | |
660 | <a href="../apps/" class="md-nav__link"> | |
661 | Apps | |
662 | </a> | |
663 | </li> | |
664 | ||
665 | ||
666 | ||
667 | ||
668 | ||
669 | ||
670 | ||
671 | <li class="md-nav__item"> | |
672 | <a href="../gdpr/" class="md-nav__link"> | |
673 | GDPR | |
674 | </a> | |
675 | </li> | |
676 | ||
677 | ||
678 | ||
679 | </ul> | |
680 | </nav> | |
681 | </li> | |
682 | ||
683 | ||
684 | ||
685 | ||
686 | ||
687 | ||
688 | ||
689 | ||
690 | ||
691 | ||
692 | ||
693 | <li class="md-nav__item md-nav__item--nested"> | |
694 | ||
695 | ||
696 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" > | |
697 | ||
698 | <label class="md-nav__link" for="__nav_3"> | |
699 | Languages, Templates & CSS | |
700 | <span class="md-nav__icon md-icon"></span> | |
701 | </label> | |
702 | <nav class="md-nav" aria-label="Languages, Templates & CSS" data-md-level="1"> | |
703 | <label class="md-nav__title" for="__nav_3"> | |
704 | <span class="md-nav__icon md-icon"></span> | |
705 | Languages, Templates & CSS | |
706 | </label> | |
707 | <ul class="md-nav__list" data-md-scrollfix> | |
708 | ||
709 | ||
710 | ||
711 | ||
712 | ||
713 | <li class="md-nav__item"> | |
714 | <a href="../../view/languages/" class="md-nav__link"> | |
715 | Languages | |
716 | </a> | |
717 | </li> | |
718 | ||
719 | ||
720 | ||
721 | ||
722 | ||
723 | ||
724 | ||
725 | <li class="md-nav__item"> | |
726 | <a href="../../view/templates/" class="md-nav__link"> | |
727 | Templates | |
728 | </a> | |
729 | </li> | |
730 | ||
731 | ||
732 | ||
733 | ||
734 | ||
735 | ||
736 | ||
737 | <li class="md-nav__item"> | |
738 | <a href="../../view/css/" class="md-nav__link"> | |
739 | CSS | |
740 | </a> | |
741 | </li> | |
742 | ||
743 | ||
744 | ||
745 | </ul> | |
746 | </nav> | |
747 | </li> | |
748 | ||
749 | ||
750 | ||
751 | ||
752 | ||
753 | ||
754 | ||
755 | ||
756 | ||
757 | ||
758 | ||
759 | <li class="md-nav__item md-nav__item--nested"> | |
760 | ||
761 | ||
762 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" > | |
763 | ||
764 | <label class="md-nav__link" for="__nav_4"> | |
765 | JavaScript API | |
766 | <span class="md-nav__icon md-icon"></span> | |
767 | </label> | |
768 | <nav class="md-nav" aria-label="JavaScript API" data-md-level="1"> | |
769 | <label class="md-nav__title" for="__nav_4"> | |
770 | <span class="md-nav__icon md-icon"></span> | |
771 | JavaScript API | |
772 | </label> | |
773 | <ul class="md-nav__list" data-md-scrollfix> | |
774 | ||
775 | ||
776 | ||
777 | ||
778 | ||
779 | <li class="md-nav__item"> | |
780 | <a href="../../javascript/general-usage/" class="md-nav__link"> | |
781 | General Usage | |
782 | </a> | |
783 | </li> | |
784 | ||
785 | ||
786 | ||
787 | ||
788 | ||
789 | ||
790 | ||
791 | ||
792 | <li class="md-nav__item md-nav__item--nested"> | |
793 | ||
794 | ||
795 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_2" type="checkbox" id="__nav_4_2" > | |
796 | ||
797 | <label class="md-nav__link" for="__nav_4_2"> | |
798 | New API | |
799 | <span class="md-nav__icon md-icon"></span> | |
800 | </label> | |
801 | <nav class="md-nav" aria-label="New API" data-md-level="2"> | |
802 | <label class="md-nav__title" for="__nav_4_2"> | |
803 | <span class="md-nav__icon md-icon"></span> | |
804 | New API | |
805 | </label> | |
806 | <ul class="md-nav__list" data-md-scrollfix> | |
807 | ||
808 | ||
809 | ||
810 | ||
811 | ||
812 | <li class="md-nav__item"> | |
813 | <a href="../../javascript/new-api_writing-a-module/" class="md-nav__link"> | |
814 | Writing a module | |
815 | </a> | |
816 | </li> | |
817 | ||
818 | ||
819 | ||
820 | ||
821 | ||
822 | ||
823 | ||
824 | <li class="md-nav__item"> | |
825 | <a href="../../javascript/new-api_data-structures/" class="md-nav__link"> | |
826 | Data Structures | |
827 | </a> | |
828 | </li> | |
829 | ||
830 | ||
831 | ||
832 | ||
833 | ||
834 | ||
835 | ||
836 | <li class="md-nav__item"> | |
837 | <a href="../../javascript/new-api_core/" class="md-nav__link"> | |
838 | Core Functions | |
839 | </a> | |
840 | </li> | |
841 | ||
842 | ||
843 | ||
844 | ||
845 | ||
846 | ||
847 | ||
848 | <li class="md-nav__item"> | |
849 | <a href="../../javascript/new-api_dom/" class="md-nav__link"> | |
850 | DOM | |
851 | </a> | |
852 | </li> | |
853 | ||
854 | ||
855 | ||
856 | ||
857 | ||
858 | ||
859 | ||
860 | <li class="md-nav__item"> | |
861 | <a href="../../javascript/new-api_events/" class="md-nav__link"> | |
862 | Event Handling | |
863 | </a> | |
864 | </li> | |
865 | ||
866 | ||
867 | ||
868 | ||
869 | ||
870 | ||
871 | ||
872 | <li class="md-nav__item"> | |
873 | <a href="../../javascript/new-api_ajax/" class="md-nav__link"> | |
874 | Ajax | |
875 | </a> | |
876 | </li> | |
877 | ||
878 | ||
879 | ||
880 | ||
881 | ||
882 | ||
883 | ||
884 | <li class="md-nav__item"> | |
885 | <a href="../../javascript/new-api_dialogs/" class="md-nav__link"> | |
886 | Dialogs | |
887 | </a> | |
888 | </li> | |
889 | ||
890 | ||
891 | ||
892 | ||
893 | ||
894 | ||
895 | ||
896 | <li class="md-nav__item"> | |
897 | <a href="../../javascript/new-api_browser/" class="md-nav__link"> | |
898 | Browser and Screen Sizes | |
899 | </a> | |
900 | </li> | |
901 | ||
902 | ||
903 | ||
904 | ||
905 | ||
906 | ||
907 | ||
908 | <li class="md-nav__item"> | |
909 | <a href="../../javascript/new-api_ui/" class="md-nav__link"> | |
910 | User Interface | |
911 | </a> | |
912 | </li> | |
913 | ||
914 | ||
915 | ||
916 | </ul> | |
917 | </nav> | |
918 | </li> | |
919 | ||
920 | ||
921 | ||
922 | ||
923 | ||
924 | ||
925 | ||
926 | <li class="md-nav__item"> | |
927 | <a href="../../javascript/legacy-api/" class="md-nav__link"> | |
928 | Legacy API | |
929 | </a> | |
930 | </li> | |
931 | ||
932 | ||
933 | ||
934 | ||
935 | ||
936 | ||
937 | ||
938 | <li class="md-nav__item"> | |
939 | <a href="../../javascript/helper-functions/" class="md-nav__link"> | |
940 | Helper Functions | |
941 | </a> | |
942 | </li> | |
943 | ||
944 | ||
945 | ||
946 | ||
947 | ||
948 | ||
949 | ||
950 | <li class="md-nav__item"> | |
951 | <a href="../../javascript/code-snippets/" class="md-nav__link"> | |
952 | Code Snippets | |
953 | </a> | |
954 | </li> | |
955 | ||
956 | ||
957 | ||
958 | </ul> | |
959 | </nav> | |
960 | </li> | |
961 | ||
962 | ||
963 | ||
964 | ||
965 | ||
966 | ||
967 | ||
968 | ||
969 | ||
970 | ||
971 | ||
972 | <li class="md-nav__item md-nav__item--nested"> | |
973 | ||
974 | ||
975 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" > | |
976 | ||
977 | <label class="md-nav__link" for="__nav_5"> | |
978 | Package Components | |
979 | <span class="md-nav__icon md-icon"></span> | |
980 | </label> | |
981 | <nav class="md-nav" aria-label="Package Components" data-md-level="1"> | |
982 | <label class="md-nav__title" for="__nav_5"> | |
983 | <span class="md-nav__icon md-icon"></span> | |
984 | Package Components | |
985 | </label> | |
986 | <ul class="md-nav__list" data-md-scrollfix> | |
987 | ||
988 | ||
989 | ||
990 | ||
991 | ||
992 | <li class="md-nav__item"> | |
993 | <a href="../../package/package-xml/" class="md-nav__link"> | |
994 | package.xml | |
995 | </a> | |
996 | </li> | |
997 | ||
998 | ||
999 | ||
1000 | ||
1001 | ||
1002 | ||
1003 | ||
1004 | ||
1005 | <li class="md-nav__item md-nav__item--nested"> | |
1006 | ||
1007 | ||
1008 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" > | |
1009 | ||
1010 | <label class="md-nav__link" for="__nav_5_2"> | |
1011 | PIPs | |
1012 | <span class="md-nav__icon md-icon"></span> | |
1013 | </label> | |
1014 | <nav class="md-nav" aria-label="PIPs" data-md-level="2"> | |
1015 | <label class="md-nav__title" for="__nav_5_2"> | |
1016 | <span class="md-nav__icon md-icon"></span> | |
1017 | PIPs | |
1018 | </label> | |
1019 | <ul class="md-nav__list" data-md-scrollfix> | |
1020 | ||
1021 | ||
1022 | ||
1023 | ||
1024 | ||
1025 | <li class="md-nav__item"> | |
1026 | <a href="../../package/pip/" class="md-nav__link"> | |
1027 | Overview | |
1028 | </a> | |
1029 | </li> | |
1030 | ||
1031 | ||
1032 | ||
1033 | ||
1034 | ||
1035 | ||
1036 | ||
1037 | <li class="md-nav__item"> | |
1038 | <a href="../../package/pip/acl-option/" class="md-nav__link"> | |
1039 | aclOption | |
1040 | </a> | |
1041 | </li> | |
1042 | ||
1043 | ||
1044 | ||
1045 | ||
1046 | ||
1047 | ||
1048 | ||
1049 | <li class="md-nav__item"> | |
1050 | <a href="../../package/pip/acp-menu/" class="md-nav__link"> | |
1051 | acpMenu | |
1052 | </a> | |
1053 | </li> | |
1054 | ||
1055 | ||
1056 | ||
1057 | ||
1058 | ||
1059 | ||
1060 | ||
1061 | <li class="md-nav__item"> | |
1062 | <a href="../../package/pip/acp-search-provider/" class="md-nav__link"> | |
1063 | acpSearchProvider | |
1064 | </a> | |
1065 | </li> | |
1066 | ||
1067 | ||
1068 | ||
1069 | ||
1070 | ||
1071 | ||
1072 | ||
1073 | <li class="md-nav__item"> | |
1074 | <a href="../../package/pip/acp-template/" class="md-nav__link"> | |
1075 | acpTemplate | |
1076 | </a> | |
1077 | </li> | |
1078 | ||
1079 | ||
1080 | ||
1081 | ||
1082 | ||
1083 | ||
1084 | ||
1085 | <li class="md-nav__item"> | |
1086 | <a href="../../package/pip/bbcode/" class="md-nav__link"> | |
1087 | bbcode | |
1088 | </a> | |
1089 | </li> | |
1090 | ||
1091 | ||
1092 | ||
1093 | ||
1094 | ||
1095 | ||
1096 | ||
1097 | <li class="md-nav__item"> | |
1098 | <a href="../../package/pip/box/" class="md-nav__link"> | |
1099 | box | |
1100 | </a> | |
1101 | </li> | |
1102 | ||
1103 | ||
1104 | ||
1105 | ||
1106 | ||
1107 | ||
1108 | ||
1109 | <li class="md-nav__item"> | |
1110 | <a href="../../package/pip/clipboard-action/" class="md-nav__link"> | |
1111 | clipboardAction | |
1112 | </a> | |
1113 | </li> | |
1114 | ||
1115 | ||
1116 | ||
1117 | ||
1118 | ||
1119 | ||
1120 | ||
1121 | <li class="md-nav__item"> | |
1122 | <a href="../../package/pip/core-object/" class="md-nav__link"> | |
1123 | coreObject | |
1124 | </a> | |
1125 | </li> | |
1126 | ||
1127 | ||
1128 | ||
1129 | ||
1130 | ||
1131 | ||
1132 | ||
1133 | <li class="md-nav__item"> | |
1134 | <a href="../../package/pip/cronjob/" class="md-nav__link"> | |
1135 | cronjob | |
1136 | </a> | |
1137 | </li> | |
1138 | ||
1139 | ||
1140 | ||
1141 | ||
1142 | ||
1143 | ||
1144 | ||
1145 | <li class="md-nav__item"> | |
1146 | <a href="../../package/pip/event-listener/" class="md-nav__link"> | |
1147 | eventListener | |
1148 | </a> | |
1149 | </li> | |
1150 | ||
1151 | ||
1152 | ||
1153 | ||
1154 | ||
1155 | ||
1156 | ||
1157 | <li class="md-nav__item"> | |
1158 | <a href="../../package/pip/file/" class="md-nav__link"> | |
1159 | file | |
1160 | </a> | |
1161 | </li> | |
1162 | ||
1163 | ||
1164 | ||
1165 | ||
1166 | ||
1167 | ||
1168 | ||
1169 | <li class="md-nav__item"> | |
1170 | <a href="../../package/pip/language/" class="md-nav__link"> | |
1171 | language | |
1172 | </a> | |
1173 | </li> | |
1174 | ||
1175 | ||
1176 | ||
1177 | ||
1178 | ||
1179 | ||
1180 | ||
1181 | <li class="md-nav__item"> | |
1182 | <a href="../../package/pip/media-provider/" class="md-nav__link"> | |
1183 | mediaProvider | |
1184 | </a> | |
1185 | </li> | |
1186 | ||
1187 | ||
1188 | ||
1189 | ||
1190 | ||
1191 | ||
1192 | ||
1193 | <li class="md-nav__item"> | |
1194 | <a href="../../package/pip/menu/" class="md-nav__link"> | |
1195 | menu | |
1196 | </a> | |
1197 | </li> | |
1198 | ||
1199 | ||
1200 | ||
1201 | ||
1202 | ||
1203 | ||
1204 | ||
1205 | <li class="md-nav__item"> | |
1206 | <a href="../../package/pip/menu-item/" class="md-nav__link"> | |
1207 | menuItem | |
1208 | </a> | |
1209 | </li> | |
1210 | ||
1211 | ||
1212 | ||
1213 | ||
1214 | ||
1215 | ||
1216 | ||
1217 | <li class="md-nav__item"> | |
1218 | <a href="../../package/pip/object-type/" class="md-nav__link"> | |
1219 | objectType | |
1220 | </a> | |
1221 | </li> | |
1222 | ||
1223 | ||
1224 | ||
1225 | ||
1226 | ||
1227 | ||
1228 | ||
1229 | <li class="md-nav__item"> | |
1230 | <a href="../../package/pip/object-type-definition/" class="md-nav__link"> | |
1231 | objectTypeDefinition | |
1232 | </a> | |
1233 | </li> | |
1234 | ||
1235 | ||
1236 | ||
1237 | ||
1238 | ||
1239 | ||
1240 | ||
1241 | <li class="md-nav__item"> | |
1242 | <a href="../../package/pip/option/" class="md-nav__link"> | |
1243 | option | |
1244 | </a> | |
1245 | </li> | |
1246 | ||
1247 | ||
1248 | ||
1249 | ||
1250 | ||
1251 | ||
1252 | ||
1253 | <li class="md-nav__item"> | |
1254 | <a href="../../package/pip/page/" class="md-nav__link"> | |
1255 | page | |
1256 | </a> | |
1257 | </li> | |
1258 | ||
1259 | ||
1260 | ||
1261 | ||
1262 | ||
1263 | ||
1264 | ||
1265 | <li class="md-nav__item"> | |
1266 | <a href="../../package/pip/pip/" class="md-nav__link"> | |
1267 | pip | |
1268 | </a> | |
1269 | </li> | |
1270 | ||
1271 | ||
1272 | ||
1273 | ||
1274 | ||
1275 | ||
1276 | ||
1277 | <li class="md-nav__item"> | |
1278 | <a href="../../package/pip/script/" class="md-nav__link"> | |
1279 | script | |
1280 | </a> | |
1281 | </li> | |
1282 | ||
1283 | ||
1284 | ||
1285 | ||
1286 | ||
1287 | ||
1288 | ||
1289 | <li class="md-nav__item"> | |
1290 | <a href="../../package/pip/smiley/" class="md-nav__link"> | |
1291 | smiley | |
1292 | </a> | |
1293 | </li> | |
1294 | ||
1295 | ||
1296 | ||
1297 | ||
1298 | ||
1299 | ||
1300 | ||
1301 | <li class="md-nav__item"> | |
1302 | <a href="../../package/pip/sql/" class="md-nav__link"> | |
1303 | sql | |
1304 | </a> | |
1305 | </li> | |
1306 | ||
1307 | ||
1308 | ||
1309 | ||
1310 | ||
1311 | ||
1312 | ||
1313 | <li class="md-nav__item"> | |
1314 | <a href="../../package/pip/style/" class="md-nav__link"> | |
1315 | style | |
1316 | </a> | |
1317 | </li> | |
1318 | ||
1319 | ||
1320 | ||
1321 | ||
1322 | ||
1323 | ||
1324 | ||
1325 | <li class="md-nav__item"> | |
1326 | <a href="../../package/pip/template/" class="md-nav__link"> | |
1327 | template | |
1328 | </a> | |
1329 | </li> | |
1330 | ||
1331 | ||
1332 | ||
1333 | ||
1334 | ||
1335 | ||
1336 | ||
1337 | <li class="md-nav__item"> | |
1338 | <a href="../../package/pip/template-listener/" class="md-nav__link"> | |
1339 | templateListener | |
1340 | </a> | |
1341 | </li> | |
1342 | ||
1343 | ||
1344 | ||
1345 | ||
1346 | ||
1347 | ||
1348 | ||
1349 | <li class="md-nav__item"> | |
1350 | <a href="../../package/pip/user-group-option/" class="md-nav__link"> | |
1351 | userGroupOption | |
1352 | </a> | |
1353 | </li> | |
1354 | ||
1355 | ||
1356 | ||
1357 | ||
1358 | ||
1359 | ||
1360 | ||
1361 | <li class="md-nav__item"> | |
1362 | <a href="../../package/pip/user-menu/" class="md-nav__link"> | |
1363 | userMenu | |
1364 | </a> | |
1365 | </li> | |
1366 | ||
1367 | ||
1368 | ||
1369 | ||
1370 | ||
1371 | ||
1372 | ||
1373 | <li class="md-nav__item"> | |
1374 | <a href="../../package/pip/user-notification-event/" class="md-nav__link"> | |
1375 | userNotificationEvent | |
1376 | </a> | |
1377 | </li> | |
1378 | ||
1379 | ||
1380 | ||
1381 | ||
1382 | ||
1383 | ||
1384 | ||
1385 | <li class="md-nav__item"> | |
1386 | <a href="../../package/pip/user-option/" class="md-nav__link"> | |
1387 | userOption | |
1388 | </a> | |
1389 | </li> | |
1390 | ||
1391 | ||
1392 | ||
1393 | ||
1394 | ||
1395 | ||
1396 | ||
1397 | <li class="md-nav__item"> | |
1398 | <a href="../../package/pip/user-profile-menu/" class="md-nav__link"> | |
1399 | userProfileMenu | |
1400 | </a> | |
1401 | </li> | |
1402 | ||
1403 | ||
1404 | ||
1405 | </ul> | |
1406 | </nav> | |
1407 | </li> | |
1408 | ||
1409 | ||
1410 | ||
1411 | ||
1412 | ||
1413 | ||
1414 | ||
1415 | <li class="md-nav__item"> | |
1416 | <a href="../../package/database-php-api/" class="md-nav__link"> | |
1417 | Database PHP API | |
1418 | </a> | |
1419 | </li> | |
1420 | ||
1421 | ||
1422 | ||
1423 | </ul> | |
1424 | </nav> | |
1425 | </li> | |
1426 | ||
1427 | ||
1428 | ||
1429 | ||
1430 | ||
1431 | ||
1432 | ||
1433 | ||
1434 | ||
1435 | ||
1436 | ||
1437 | <li class="md-nav__item md-nav__item--nested"> | |
1438 | ||
1439 | ||
1440 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" > | |
1441 | ||
1442 | <label class="md-nav__link" for="__nav_6"> | |
1443 | Migration | |
1444 | <span class="md-nav__icon md-icon"></span> | |
1445 | </label> | |
1446 | <nav class="md-nav" aria-label="Migration" data-md-level="1"> | |
1447 | <label class="md-nav__title" for="__nav_6"> | |
1448 | <span class="md-nav__icon md-icon"></span> | |
1449 | Migration | |
1450 | </label> | |
1451 | <ul class="md-nav__list" data-md-scrollfix> | |
1452 | ||
1453 | ||
1454 | ||
1455 | ||
1456 | ||
1457 | ||
1458 | <li class="md-nav__item md-nav__item--nested"> | |
1459 | ||
1460 | ||
1461 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_1" type="checkbox" id="__nav_6_1" > | |
1462 | ||
1463 | <label class="md-nav__link" for="__nav_6_1"> | |
1464 | Migrating from WSC 5.3 | |
1465 | <span class="md-nav__icon md-icon"></span> | |
1466 | </label> | |
1467 | <nav class="md-nav" aria-label="Migrating from WSC 5.3" data-md-level="2"> | |
1468 | <label class="md-nav__title" for="__nav_6_1"> | |
1469 | <span class="md-nav__icon md-icon"></span> | |
1470 | Migrating from WSC 5.3 | |
1471 | </label> | |
1472 | <ul class="md-nav__list" data-md-scrollfix> | |
1473 | ||
1474 | ||
1475 | ||
1476 | ||
1477 | ||
1478 | <li class="md-nav__item"> | |
1479 | <a href="../../migration/wsc53/php/" class="md-nav__link"> | |
1480 | PHP API | |
1481 | </a> | |
1482 | </li> | |
1483 | ||
1484 | ||
1485 | ||
1486 | ||
1487 | ||
1488 | ||
1489 | ||
1490 | <li class="md-nav__item"> | |
1491 | <a href="../../migration/wsc53/session/" class="md-nav__link"> | |
1492 | Session Handling and Authentication | |
1493 | </a> | |
1494 | </li> | |
1495 | ||
1496 | ||
1497 | ||
1498 | ||
1499 | ||
1500 | ||
1501 | ||
1502 | <li class="md-nav__item"> | |
1503 | <a href="../../migration/wsc53/javascript/" class="md-nav__link"> | |
1504 | JavaScript | |
1505 | </a> | |
1506 | </li> | |
1507 | ||
1508 | ||
1509 | ||
1510 | ||
1511 | ||
1512 | ||
1513 | ||
1514 | <li class="md-nav__item"> | |
1515 | <a href="../../migration/wsc53/templates/" class="md-nav__link"> | |
1516 | Templates | |
1517 | </a> | |
1518 | </li> | |
1519 | ||
1520 | ||
1521 | ||
1522 | ||
1523 | ||
1524 | ||
1525 | ||
1526 | <li class="md-nav__item"> | |
1527 | <a href="../../migration/wsc53/libraries/" class="md-nav__link"> | |
1528 | Third Party Libraries | |
1529 | </a> | |
1530 | </li> | |
1531 | ||
1532 | ||
1533 | ||
1534 | </ul> | |
1535 | </nav> | |
1536 | </li> | |
1537 | ||
1538 | ||
1539 | ||
1540 | ||
1541 | ||
1542 | ||
1543 | ||
1544 | ||
1545 | <li class="md-nav__item md-nav__item--nested"> | |
1546 | ||
1547 | ||
1548 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_2" type="checkbox" id="__nav_6_2" > | |
1549 | ||
1550 | <label class="md-nav__link" for="__nav_6_2"> | |
1551 | Migrating from WSC 5.2 | |
1552 | <span class="md-nav__icon md-icon"></span> | |
1553 | </label> | |
1554 | <nav class="md-nav" aria-label="Migrating from WSC 5.2" data-md-level="2"> | |
1555 | <label class="md-nav__title" for="__nav_6_2"> | |
1556 | <span class="md-nav__icon md-icon"></span> | |
1557 | Migrating from WSC 5.2 | |
1558 | </label> | |
1559 | <ul class="md-nav__list" data-md-scrollfix> | |
1560 | ||
1561 | ||
1562 | ||
1563 | ||
1564 | ||
1565 | <li class="md-nav__item"> | |
1566 | <a href="../../migration/wsc52/php/" class="md-nav__link"> | |
1567 | PHP API | |
1568 | </a> | |
1569 | </li> | |
1570 | ||
1571 | ||
1572 | ||
1573 | ||
1574 | ||
1575 | ||
1576 | ||
1577 | <li class="md-nav__item"> | |
1578 | <a href="../../migration/wsc52/templates/" class="md-nav__link"> | |
1579 | Templates and Languages | |
1580 | </a> | |
1581 | </li> | |
1582 | ||
1583 | ||
1584 | ||
1585 | ||
1586 | ||
1587 | ||
1588 | ||
1589 | <li class="md-nav__item"> | |
1590 | <a href="../../migration/wsc52/libraries/" class="md-nav__link"> | |
1591 | Third Party Libraries | |
1592 | </a> | |
1593 | </li> | |
1594 | ||
1595 | ||
1596 | ||
1597 | </ul> | |
1598 | </nav> | |
1599 | </li> | |
1600 | ||
1601 | ||
1602 | ||
1603 | ||
1604 | ||
1605 | ||
1606 | ||
1607 | ||
1608 | <li class="md-nav__item md-nav__item--nested"> | |
1609 | ||
1610 | ||
1611 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_3" type="checkbox" id="__nav_6_3" > | |
1612 | ||
1613 | <label class="md-nav__link" for="__nav_6_3"> | |
1614 | Migrating from WSC 3.1 | |
1615 | <span class="md-nav__icon md-icon"></span> | |
1616 | </label> | |
1617 | <nav class="md-nav" aria-label="Migrating from WSC 3.1" data-md-level="2"> | |
1618 | <label class="md-nav__title" for="__nav_6_3"> | |
1619 | <span class="md-nav__icon md-icon"></span> | |
1620 | Migrating from WSC 3.1 | |
1621 | </label> | |
1622 | <ul class="md-nav__list" data-md-scrollfix> | |
1623 | ||
1624 | ||
1625 | ||
1626 | ||
1627 | ||
1628 | <li class="md-nav__item"> | |
1629 | <a href="../../migration/wsc31/php/" class="md-nav__link"> | |
1630 | PHP API | |
1631 | </a> | |
1632 | </li> | |
1633 | ||
1634 | ||
1635 | ||
1636 | </ul> | |
1637 | </nav> | |
1638 | </li> | |
1639 | ||
1640 | ||
1641 | ||
1642 | ||
1643 | ||
1644 | ||
1645 | ||
1646 | ||
1647 | <li class="md-nav__item md-nav__item--nested"> | |
1648 | ||
1649 | ||
1650 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_4" type="checkbox" id="__nav_6_4" > | |
1651 | ||
1652 | <label class="md-nav__link" for="__nav_6_4"> | |
1653 | Migrating from WSC 3.0 | |
1654 | <span class="md-nav__icon md-icon"></span> | |
1655 | </label> | |
1656 | <nav class="md-nav" aria-label="Migrating from WSC 3.0" data-md-level="2"> | |
1657 | <label class="md-nav__title" for="__nav_6_4"> | |
1658 | <span class="md-nav__icon md-icon"></span> | |
1659 | Migrating from WSC 3.0 | |
1660 | </label> | |
1661 | <ul class="md-nav__list" data-md-scrollfix> | |
1662 | ||
1663 | ||
1664 | ||
1665 | ||
1666 | ||
1667 | <li class="md-nav__item"> | |
1668 | <a href="../../migration/wsc30/php/" class="md-nav__link"> | |
1669 | PHP API | |
1670 | </a> | |
1671 | </li> | |
1672 | ||
1673 | ||
1674 | ||
1675 | ||
1676 | ||
1677 | ||
1678 | ||
1679 | <li class="md-nav__item"> | |
1680 | <a href="../../migration/wsc30/javascript/" class="md-nav__link"> | |
1681 | JavaScript API | |
1682 | </a> | |
1683 | </li> | |
1684 | ||
1685 | ||
1686 | ||
1687 | ||
1688 | ||
1689 | ||
1690 | ||
1691 | <li class="md-nav__item"> | |
1692 | <a href="../../migration/wsc30/templates/" class="md-nav__link"> | |
1693 | Templates | |
1694 | </a> | |
1695 | </li> | |
1696 | ||
1697 | ||
1698 | ||
1699 | ||
1700 | ||
1701 | ||
1702 | ||
1703 | <li class="md-nav__item"> | |
1704 | <a href="../../migration/wsc30/css/" class="md-nav__link"> | |
1705 | CSS | |
1706 | </a> | |
1707 | </li> | |
1708 | ||
1709 | ||
1710 | ||
1711 | ||
1712 | ||
1713 | ||
1714 | ||
1715 | <li class="md-nav__item"> | |
1716 | <a href="../../migration/wsc30/package/" class="md-nav__link"> | |
1717 | Package Components | |
1718 | </a> | |
1719 | </li> | |
1720 | ||
1721 | ||
1722 | ||
1723 | </ul> | |
1724 | </nav> | |
1725 | </li> | |
1726 | ||
1727 | ||
1728 | ||
1729 | ||
1730 | ||
1731 | ||
1732 | ||
1733 | ||
1734 | <li class="md-nav__item md-nav__item--nested"> | |
1735 | ||
1736 | ||
1737 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_5" type="checkbox" id="__nav_6_5" > | |
1738 | ||
1739 | <label class="md-nav__link" for="__nav_6_5"> | |
1740 | Migrating from WCF 2.1 | |
1741 | <span class="md-nav__icon md-icon"></span> | |
1742 | </label> | |
1743 | <nav class="md-nav" aria-label="Migrating from WCF 2.1" data-md-level="2"> | |
1744 | <label class="md-nav__title" for="__nav_6_5"> | |
1745 | <span class="md-nav__icon md-icon"></span> | |
1746 | Migrating from WCF 2.1 | |
1747 | </label> | |
1748 | <ul class="md-nav__list" data-md-scrollfix> | |
1749 | ||
1750 | ||
1751 | ||
1752 | ||
1753 | ||
1754 | <li class="md-nav__item"> | |
1755 | <a href="../../migration/wcf21/php/" class="md-nav__link"> | |
1756 | PHP API | |
1757 | </a> | |
1758 | </li> | |
1759 | ||
1760 | ||
1761 | ||
1762 | ||
1763 | ||
1764 | ||
1765 | ||
1766 | <li class="md-nav__item"> | |
1767 | <a href="../../migration/wcf21/templates/" class="md-nav__link"> | |
1768 | Templates | |
1769 | </a> | |
1770 | </li> | |
1771 | ||
1772 | ||
1773 | ||
1774 | ||
1775 | ||
1776 | ||
1777 | ||
1778 | <li class="md-nav__item"> | |
1779 | <a href="../../migration/wcf21/css/" class="md-nav__link"> | |
1780 | CSS | |
1781 | </a> | |
1782 | </li> | |
1783 | ||
1784 | ||
1785 | ||
1786 | ||
1787 | ||
1788 | ||
1789 | ||
1790 | <li class="md-nav__item"> | |
1791 | <a href="../../migration/wcf21/package/" class="md-nav__link"> | |
1792 | Package Components | |
1793 | </a> | |
1794 | </li> | |
1795 | ||
1796 | ||
1797 | ||
1798 | </ul> | |
1799 | </nav> | |
1800 | </li> | |
1801 | ||
1802 | ||
1803 | ||
1804 | </ul> | |
1805 | </nav> | |
1806 | </li> | |
1807 | ||
1808 | ||
1809 | ||
1810 | ||
1811 | ||
1812 | ||
1813 | ||
1814 | ||
1815 | ||
1816 | ||
1817 | ||
1818 | <li class="md-nav__item md-nav__item--nested"> | |
1819 | ||
1820 | ||
1821 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" > | |
1822 | ||
1823 | <label class="md-nav__link" for="__nav_7"> | |
1824 | Tutorials | |
1825 | <span class="md-nav__icon md-icon"></span> | |
1826 | </label> | |
1827 | <nav class="md-nav" aria-label="Tutorials" data-md-level="1"> | |
1828 | <label class="md-nav__title" for="__nav_7"> | |
1829 | <span class="md-nav__icon md-icon"></span> | |
1830 | Tutorials | |
1831 | </label> | |
1832 | <ul class="md-nav__list" data-md-scrollfix> | |
1833 | ||
1834 | ||
1835 | ||
1836 | ||
1837 | ||
1838 | ||
1839 | <li class="md-nav__item md-nav__item--nested"> | |
1840 | ||
1841 | ||
1842 | <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_1" type="checkbox" id="__nav_7_1" > | |
1843 | ||
1844 | <label class="md-nav__link" for="__nav_7_1"> | |
1845 | Tutorial Series | |
1846 | <span class="md-nav__icon md-icon"></span> | |
1847 | </label> | |
1848 | <nav class="md-nav" aria-label="Tutorial Series" data-md-level="2"> | |
1849 | <label class="md-nav__title" for="__nav_7_1"> | |
1850 | <span class="md-nav__icon md-icon"></span> | |
1851 | Tutorial Series | |
1852 | </label> | |
1853 | <ul class="md-nav__list" data-md-scrollfix> | |
1854 | ||
1855 | ||
1856 | ||
1857 | ||
1858 | ||
1859 | <li class="md-nav__item"> | |
1860 | <a href="../../tutorial/series/overview/" class="md-nav__link"> | |
1861 | Overview | |
1862 | </a> | |
1863 | </li> | |
1864 | ||
1865 | ||
1866 | ||
1867 | ||
1868 | ||
1869 | ||
1870 | ||
1871 | <li class="md-nav__item"> | |
1872 | <a href="../../tutorial/series/part_1/" class="md-nav__link"> | |
1873 | Part 1 | |
1874 | </a> | |
1875 | </li> | |
1876 | ||
1877 | ||
1878 | ||
1879 | ||
1880 | ||
1881 | ||
1882 | ||
1883 | <li class="md-nav__item"> | |
1884 | <a href="../../tutorial/series/part_2/" class="md-nav__link"> | |
1885 | Part 2 | |
1886 | </a> | |
1887 | </li> | |
1888 | ||
1889 | ||
1890 | ||
1891 | ||
1892 | ||
1893 | ||
1894 | ||
1895 | <li class="md-nav__item"> | |
1896 | <a href="../../tutorial/series/part_3/" class="md-nav__link"> | |
1897 | Part 3 | |
1898 | </a> | |
1899 | </li> | |
1900 | ||
1901 | ||
1902 | ||
1903 | </ul> | |
1904 | </nav> | |
1905 | </li> | |
1906 | ||
1907 | ||
1908 | ||
1909 | </ul> | |
1910 | </nav> | |
1911 | </li> | |
1912 | ||
1913 | ||
1914 | ||
1915 | </ul> | |
1916 | </nav> | |
1917 | </div> | |
1918 | </div> | |
1919 | </div> | |
1920 | ||
1921 | ||
1922 | ||
1923 | <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" > | |
1924 | <div class="md-sidebar__scrollwrap"> | |
1925 | <div class="md-sidebar__inner"> | |
1926 | ||
1927 | <nav class="md-nav md-nav--secondary" aria-label="Table of contents"> | |
1928 | ||
1929 | ||
1930 | ||
1931 | ||
1932 | ||
1933 | <label class="md-nav__title" for="__toc"> | |
1934 | <span class="md-nav__icon md-icon"></span> | |
1935 | Table of contents | |
1936 | </label> | |
1937 | <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix> | |
1938 | ||
1939 | <li class="md-nav__item"> | |
1940 | <a href="#databaseobject" class="md-nav__link"> | |
1941 | DatabaseObject | |
1942 | </a> | |
1943 | ||
1944 | </li> | |
1945 | ||
1946 | <li class="md-nav__item"> | |
1947 | <a href="#databaseobjectdecorator" class="md-nav__link"> | |
1948 | DatabaseObjectDecorator | |
1949 | </a> | |
1950 | ||
1951 | </li> | |
1952 | ||
1953 | <li class="md-nav__item"> | |
1954 | <a href="#databaseobjecteditor" class="md-nav__link"> | |
1955 | DatabaseObjectEditor | |
1956 | </a> | |
1957 | ||
1958 | <nav class="md-nav" aria-label="DatabaseObjectEditor"> | |
1959 | <ul class="md-nav__list"> | |
1960 | ||
1961 | <li class="md-nav__item"> | |
1962 | <a href="#create-a-new-row" class="md-nav__link"> | |
1963 | Create a new row | |
1964 | </a> | |
1965 | ||
1966 | </li> | |
1967 | ||
1968 | <li class="md-nav__item"> | |
1969 | <a href="#updating-an-existing-row" class="md-nav__link"> | |
1970 | Updating an existing row | |
1971 | </a> | |
1972 | ||
1973 | </li> | |
1974 | ||
1975 | <li class="md-nav__item"> | |
1976 | <a href="#deleting-a-row" class="md-nav__link"> | |
1977 | Deleting a row | |
1978 | </a> | |
1979 | ||
1980 | </li> | |
1981 | ||
1982 | </ul> | |
1983 | </nav> | |
1984 | ||
1985 | </li> | |
1986 | ||
1987 | <li class="md-nav__item"> | |
1988 | <a href="#databaseobjectlist" class="md-nav__link"> | |
1989 | DatabaseObjectList | |
1990 | </a> | |
1991 | ||
1992 | </li> | |
1993 | ||
1994 | <li class="md-nav__item"> | |
1995 | <a href="#abstractdatabaseobjectaction" class="md-nav__link"> | |
1996 | AbstractDatabaseObjectAction | |
1997 | </a> | |
1998 | ||
1999 | <nav class="md-nav" aria-label="AbstractDatabaseObjectAction"> | |
2000 | <ul class="md-nav__list"> | |
2001 | ||
2002 | <li class="md-nav__item"> | |
2003 | <a href="#executing-an-action" class="md-nav__link"> | |
2004 | Executing an Action | |
2005 | </a> | |
2006 | ||
2007 | </li> | |
2008 | ||
2009 | <li class="md-nav__item"> | |
2010 | <a href="#custom-method-with-ajax-support" class="md-nav__link"> | |
2011 | Custom Method with AJAX Support | |
2012 | </a> | |
2013 | ||
2014 | <nav class="md-nav" aria-label="Custom Method with AJAX Support"> | |
2015 | <ul class="md-nav__list"> | |
2016 | ||
2017 | <li class="md-nav__item"> | |
2018 | <a href="#ajax-validation" class="md-nav__link"> | |
2019 | AJAX Validation | |
2020 | </a> | |
2021 | ||
2022 | </li> | |
2023 | ||
2024 | <li class="md-nav__item"> | |
2025 | <a href="#create-update-and-delete" class="md-nav__link"> | |
2026 | create, update and delete | |
2027 | </a> | |
2028 | ||
2029 | </li> | |
2030 | ||
2031 | <li class="md-nav__item"> | |
2032 | <a href="#allow-invokation-by-guests" class="md-nav__link"> | |
2033 | Allow Invokation by Guests | |
2034 | </a> | |
2035 | ||
2036 | </li> | |
2037 | ||
2038 | <li class="md-nav__item"> | |
2039 | <a href="#acp-access-only" class="md-nav__link"> | |
2040 | ACP Access Only | |
2041 | </a> | |
2042 | ||
2043 | </li> | |
2044 | ||
2045 | </ul> | |
2046 | </nav> | |
2047 | ||
2048 | </li> | |
2049 | ||
2050 | </ul> | |
2051 | </nav> | |
2052 | ||
2053 | </li> | |
2054 | ||
2055 | </ul> | |
2056 | ||
2057 | </nav> | |
2058 | </div> | |
2059 | </div> | |
2060 | </div> | |
2061 | ||
2062 | ||
2063 | <div class="md-content" data-md-component="content"> | |
2064 | <article class="md-content__inner md-typeset"> | |
2065 | ||
2066 | ||
9b8bddda | 2067 | <a href="https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/php/database-objects.md" title="Edit this page" class="md-content__button md-icon"> |
7124f4cb WG |
2068 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg> |
2069 | </a> | |
2070 | ||
45ca63d0 TD |
2071 | |
2072 | <h1 id="database-objects">Database Objects<a class="headerlink" href="#database-objects" title="Permanent link">#</a></h1> | |
2073 | <p>WoltLab Suite uses a unified interface to work with database rows using an object based approach instead of using native arrays holding arbitrary data. Each database table is mapped to a model class that is designed to hold a single record from that table and expose methods to work with the stored data, for example providing assistance when working with normalized datasets.</p> | |
2074 | <p>Developers are required to provide the proper DatabaseObject implementations themselves, they're not automatically generated, all though the actual code that needs to be written is rather small. The following examples assume the fictional database table <code>wcf1_example</code>, <code>exampleID</code> as the auto-incrementing primary key and the column <code>bar</code> to store some text.</p> | |
2075 | <h2 id="databaseobject">DatabaseObject<a class="headerlink" href="#databaseobject" title="Permanent link">#</a></h2> | |
2076 | <p>The basic model derives from <code>wcf\data\DatabaseObject</code> and provides a convenient constructor to fetch a single row or construct an instance using pre-loaded rows.</p> | |
2077 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2078 | <span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span> | |
2079 | <span class="k">use</span> <span class="nx">wcf\data\DatabaseObject</span><span class="p">;</span> | |
2080 | ||
2081 | <span class="k">class</span> <span class="nc">Example</span> <span class="k">extends</span> <span class="nx">DatabaseObject</span> <span class="p">{}</span> | |
2082 | </code></pre></div> | |
45ca63d0 TD |
2083 | <p>The class is intended to be empty by default and there only needs to be code if you want to add additional logic to your model. Both the class name and primary key are determined by <code>DatabaseObject</code> using the namespace and class name of the derived class. The example above uses the namespace <code>wcf\…</code> which is used as table prefix and the class name <code>Example</code> is converted into <code>exampleID</code>, resulting in the database table name <code>wcfN_example</code> with the primary key <code>exampleID</code>.</p> |
2084 | <p>You can prevent this automatic guessing by setting the class properties <code>$databaseTableName</code> and <code>$databaseTableIndexName</code> manually.</p> | |
2085 | <h2 id="databaseobjectdecorator">DatabaseObjectDecorator<a class="headerlink" href="#databaseobjectdecorator" title="Permanent link">#</a></h2> | |
2086 | <p>If you already have a <code>DatabaseObject</code> class and would like to extend it with additional data or methods, for example by providing a class <code>ViewableExample</code> which features view-related changes without polluting the original object, you can use <code>DatabaseObjectDecorator</code> which a default implementation of a decorator for database objects.</p> | |
2087 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2088 | <span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span> | |
2089 | <span class="k">use</span> <span class="nx">wcf\data\DatabaseObjectDecorator</span><span class="p">;</span> | |
2090 | ||
2091 | <span class="k">class</span> <span class="nc">ViewableExample</span> <span class="k">extends</span> <span class="nx">DatabaseObjectDecorator</span> <span class="p">{</span> | |
2092 | <span class="k">protected</span> <span class="k">static</span> <span class="nv">$baseClass</span> <span class="o">=</span> <span class="nx">Example</span><span class="o">::</span><span class="na">class</span><span class="p">;</span> | |
2093 | ||
2094 | <span class="k">public</span> <span class="k">function</span> <span class="nf">getOutput</span><span class="p">()</span> <span class="p">{</span> | |
2095 | <span class="nv">$output</span> <span class="o">=</span> <span class="s1">''</span><span class="p">;</span> | |
2096 | ||
2097 | <span class="c1">// [determine output]</span> | |
2098 | ||
2099 | <span class="k">return</span> <span class="nv">$output</span><span class="p">;</span> | |
2100 | <span class="p">}</span> | |
2101 | <span class="p">}</span> | |
2102 | </code></pre></div> | |
45ca63d0 TD |
2103 | <p>It is mandatory to set the static <code>$baseClass</code> property to the name of the decorated class.</p> |
2104 | <p>Like for any decorator, you can directly access the decorated object's properties and methods for a decorated object by accessing the property or calling the method on the decorated object. | |
2105 | You can access the decorated objects directly via <code>DatabaseObjectDecorator::getDecoratedObject()</code>.</p> | |
2106 | <h2 id="databaseobjecteditor">DatabaseObjectEditor<a class="headerlink" href="#databaseobjecteditor" title="Permanent link">#</a></h2> | |
2107 | <div class="admonition info"> | |
2108 | <p class="admonition-title">This is the low-level interface to manipulate data rows, it is recommended to use <code>AbstractDatabaseObjectAction</code>.</p> | |
2109 | </div> | |
2110 | <p>Adding, editing and deleting models is done using the <code>DatabaseObjectEditor</code> class that decorates a <code>DatabaseObject</code> and uses its data to perform the actions.</p> | |
2111 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2112 | <span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span> | |
2113 | <span class="k">use</span> <span class="nx">wcf\data\DatabaseObjectEditor</span><span class="p">;</span> | |
2114 | ||
2115 | <span class="k">class</span> <span class="nc">ExampleEditor</span> <span class="k">extends</span> <span class="nx">DatabaseObjectEditor</span> <span class="p">{</span> | |
2116 | <span class="k">protected</span> <span class="k">static</span> <span class="nv">$baseClass</span> <span class="o">=</span> <span class="nx">Example</span><span class="o">::</span><span class="na">class</span><span class="p">;</span> | |
2117 | <span class="p">}</span> | |
2118 | </code></pre></div> | |
45ca63d0 TD |
2119 | <p>The editor class requires you to provide the fully qualified name of the model, that is the class name including the complete namespace. Database table name and index key will be pulled directly from the model.</p> |
2120 | <h3 id="create-a-new-row">Create a new row<a class="headerlink" href="#create-a-new-row" title="Permanent link">#</a></h3> | |
2121 | <p>Inserting a new row into the database table is provided through <code>DatabaseObjectEditor::create()</code> which yields a <code>DatabaseObject</code> instance after creation.</p> | |
2122 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2123 | <span class="nv">$example</span> <span class="o">=</span> <span class="nx">\wcf\data\example\ExampleEditor</span><span class="o">::</span><span class="na">create</span><span class="p">([</span> | |
2124 | <span class="s1">'bar'</span> <span class="o">=></span> <span class="s1">'Hello World!'</span> | |
2125 | <span class="p">]);</span> | |
2126 | ||
2127 | <span class="c1">// output: Hello World!</span> | |
2128 | <span class="k">echo</span> <span class="nv">$example</span><span class="o">-></span><span class="na">bar</span><span class="p">;</span> | |
2129 | </code></pre></div> | |
45ca63d0 TD |
2130 | <h3 id="updating-an-existing-row">Updating an existing row<a class="headerlink" href="#updating-an-existing-row" title="Permanent link">#</a></h3> |
2131 | <div class="admonition warning"> | |
2132 | <p class="admonition-title">The internal state of the decorated <code>DatabaseObject</code> is not altered at any point, the values will still be the same after editing or deleting the represented row. If you need an object with the latest data, you'll have to discard the current object and refetch the data from database.</p> | |
2133 | </div> | |
2134 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2135 | <span class="nv">$example</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\wcf\data\example\Example</span><span class="p">(</span><span class="nv">$id</span><span class="p">);</span> | |
2136 | <span class="nv">$exampleEditor</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\wcf\data\example\ExampleEditor</span><span class="p">(</span><span class="nv">$example</span><span class="p">);</span> | |
2137 | <span class="nv">$exampleEditor</span><span class="o">-></span><span class="na">update</span><span class="p">([</span> | |
2138 | <span class="s1">'bar'</span> <span class="o">=></span> <span class="s1">'baz'</span> | |
2139 | <span class="p">]);</span> | |
2140 | ||
2141 | <span class="c1">// output: Hello World!</span> | |
2142 | <span class="k">echo</span> <span class="nv">$example</span><span class="o">-></span><span class="na">bar</span><span class="p">;</span> | |
2143 | ||
2144 | <span class="c1">// re-creating the object will query the database again and retrieve the updated value</span> | |
2145 | <span class="nv">$example</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\wcf\data\example\Example</span><span class="p">(</span><span class="nv">$example</span><span class="o">-></span><span class="na">id</span><span class="p">);</span> | |
2146 | ||
2147 | <span class="c1">// output: baz</span> | |
2148 | <span class="k">echo</span> <span class="nv">$example</span><span class="o">-></span><span class="na">bar</span><span class="p">;</span> | |
2149 | </code></pre></div> | |
45ca63d0 TD |
2150 | <h3 id="deleting-a-row">Deleting a row<a class="headerlink" href="#deleting-a-row" title="Permanent link">#</a></h3> |
2151 | <div class="admonition warning"> | |
2152 | <p class="admonition-title">Similar to the update process, the decorated <code>DatabaseObject</code> is not altered and will then point to an inexistent row.</p> | |
2153 | </div> | |
2154 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2155 | <span class="nv">$example</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\wcf\data\example\Example</span><span class="p">(</span><span class="nv">$id</span><span class="p">);</span> | |
2156 | <span class="nv">$exampleEditor</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\wcf\data\example\ExampleEditor</span><span class="p">(</span><span class="nv">$example</span><span class="p">);</span> | |
2157 | <span class="nv">$exampleEditor</span><span class="o">-></span><span class="na">delete</span><span class="p">();</span> | |
2158 | </code></pre></div> | |
45ca63d0 TD |
2159 | <h2 id="databaseobjectlist">DatabaseObjectList<a class="headerlink" href="#databaseobjectlist" title="Permanent link">#</a></h2> |
2160 | <p>Every row is represented as a single instance of the model, but the instance creation deals with single rows only. Retrieving larger sets of rows would be quite inefficient due to the large amount of queries that will be dispatched. This is solved with the <code>DatabaseObjectList</code> object that exposes an interface to query the database table using arbitrary conditions for data selection. All rows will be fetched using a single query and the resulting rows are automatically loaded into separate models.</p> | |
2161 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2162 | <span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span> | |
2163 | <span class="k">use</span> <span class="nx">wcf\data\DatabaseObjectList</span><span class="p">;</span> | |
2164 | ||
2165 | <span class="k">class</span> <span class="nc">ExampleList</span> <span class="k">extends</span> <span class="nx">DatabaseObjectList</span> <span class="p">{</span> | |
2166 | <span class="k">public</span> <span class="nv">$className</span> <span class="o">=</span> <span class="nx">Example</span><span class="o">::</span><span class="na">class</span><span class="p">;</span> | |
2167 | <span class="p">}</span> | |
2168 | </code></pre></div> | |
45ca63d0 TD |
2169 | <p>The following code listing illustrates loading a large set of examples and iterating over the list to retrieve the objects.</p> |
2170 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2171 | <span class="nv">$exampleList</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\wcf\data\example\ExampleList</span><span class="p">();</span> | |
2172 | <span class="c1">// add constraints using the condition builder</span> | |
2173 | <span class="nv">$exampleList</span><span class="o">-></span><span class="na">getConditionBuilder</span><span class="p">()</span><span class="o">-></span><span class="na">add</span><span class="p">(</span><span class="s1">'bar IN (?)'</span><span class="p">,</span> <span class="p">[[</span><span class="s1">'Hello World!'</span><span class="p">,</span> <span class="s1">'bar'</span><span class="p">,</span> <span class="s1">'baz'</span><span class="p">]]);</span> | |
2174 | <span class="c1">// actually read the rows</span> | |
2175 | <span class="nv">$exampleList</span><span class="o">-></span><span class="na">readObjects</span><span class="p">();</span> | |
2176 | <span class="k">foreach</span> <span class="p">(</span><span class="nv">$exampleList</span> <span class="k">as</span> <span class="nv">$example</span><span class="p">)</span> <span class="p">{</span> | |
2177 | <span class="k">echo</span> <span class="nv">$example</span><span class="o">-></span><span class="na">bar</span><span class="p">;</span> | |
2178 | <span class="p">}</span> | |
2179 | ||
2180 | <span class="c1">// retrieve the models directly instead of iterating over them</span> | |
2181 | <span class="nv">$examples</span> <span class="o">=</span> <span class="nv">$exampleList</span><span class="o">-></span><span class="na">getObjects</span><span class="p">();</span> | |
2182 | ||
2183 | <span class="c1">// just retrieve the number of rows</span> | |
2184 | <span class="nv">$exampleCount</span> <span class="o">=</span> <span class="nv">$exampleList</span><span class="o">-></span><span class="na">countObjects</span><span class="p">();</span> | |
2185 | </code></pre></div> | |
45ca63d0 TD |
2186 | <p><code>DatabaseObjectList</code> implements both <a href="https://secure.php.net/manual/en/class.seekableiterator.php">SeekableIterator</a> and <a href="https://secure.php.net/manual/en/class.countable.php">Countable</a>.</p> |
2187 | <p>Additionally, <code>DatabaseObjectList</code> objects has the following three public properties that are useful when fetching data with lists:</p> | |
2188 | <ul> | |
2189 | <li><code>$sqlLimit</code> determines how many rows are fetched. | |
2190 | If its value is <code>0</code> (which is the default value), all results are fetched. | |
2191 | So be careful when dealing with large tables and you only want a limited number of rows: | |
2192 | Set <code>$sqlLimit</code> to a value larger than zero!</li> | |
2193 | <li><code>$sqlOffset</code>: | |
2194 | Paginated pages like a thread list use this feature a lot, it allows you to skip a given number of results. | |
2195 | Imagine you want to display 20 threads per page but there are a total of 60 threads available. | |
2196 | In this case you would specify <code>$sqlLimit = 20</code> and <code>$sqlOffset = 20</code> which will skip the first 20 threads, effectively displaying thread 21 to 40.</li> | |
2197 | <li><code>$sqlOrderBy</code> determines by which column(s) the rows are sorted in which order. | |
2198 | Using our example in <code>$sqlOffset</code> you might want to display the 20 most recent threads on page 1, thus you should specify the order field and its direction, e.g. <code>$sqlOrderBy = 'thread.lastPostTime DESC'</code> which returns the most recent thread first.</li> | |
2199 | </ul> | |
2200 | <p>For more advanced usage, there two additional fields that deal with the type of objects returned. | |
2201 | First, let's go into a bit more detail what setting the <code>$className</code> property actually does:</p> | |
2202 | <ol> | |
2203 | <li>It is the type of database object in which the rows are wrapped.</li> | |
2204 | <li>It determines which database table is actually queried and which index is used (see the <code>$databaseTableName</code> and <code>$databaseTableIndexName</code> properties of <code>DatabaseObject</code>).</li> | |
2205 | </ol> | |
2206 | <p>Sometimes you might use the database table of some database object but wrap the rows in another database object. | |
2207 | This can be achieved by setting the <code>$objectClassName</code> property to the desired class name.</p> | |
2208 | <p>In other cases, you might want to wrap the created objects in a database object decorator which can be done by setting the <code>$decoratorClassName</code> property to the desired class name:</p> | |
2209 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2210 | <span class="nv">$exampleList</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">\wcf\data\example\ExampleList</span><span class="p">();</span> | |
2211 | <span class="nv">$exampleList</span><span class="o">-></span><span class="na">decoratorClassName</span> <span class="o">=</span> <span class="nx">\wcf\data\example\ViewableExample</span><span class="o">::</span><span class="na">class</span><span class="p">;</span> | |
2212 | </code></pre></div> | |
45ca63d0 TD |
2213 | <p>Of course, you do not have to set the property after creating the list object, you can also set it by creating a dedicated class:</p> |
2214 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2215 | <span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span> | |
2216 | ||
2217 | <span class="k">class</span> <span class="nc">ViewableExampleList</span> <span class="k">extends</span> <span class="nx">ExampleList</span> <span class="p">{</span> | |
2218 | <span class="k">public</span> <span class="nv">$decoratorClassName</span> <span class="o">=</span> <span class="nx">ViewableExample</span><span class="o">::</span><span class="na">class</span><span class="p">;</span> | |
2219 | <span class="p">}</span> | |
2220 | </code></pre></div> | |
45ca63d0 TD |
2221 | <h2 id="abstractdatabaseobjectaction">AbstractDatabaseObjectAction<a class="headerlink" href="#abstractdatabaseobjectaction" title="Permanent link">#</a></h2> |
2222 | <p>Row creation and manipulation can be performed using the aforementioned <code>DatabaseObjectEditor</code> class, but this approach has two major issues:</p> | |
2223 | <ol> | |
2224 | <li>Row creation, update and deletion takes place silently without notifying any other components.</li> | |
2225 | <li>Data is passed to the database adapter without any further processing.</li> | |
2226 | </ol> | |
2227 | <p>The <code>AbstractDatabaseObjectAction</code> solves both problems by wrapping around the editor class and thus provide an additional layer between the action that should be taken and the actual process. The first problem is solved by a fixed set of events being fired, the second issue is addressed by having a single entry point for all data editing.</p> | |
2228 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2229 | <span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span> | |
2230 | <span class="k">use</span> <span class="nx">wcf\data\AbstractDatabaseObjectAction</span><span class="p">;</span> | |
2231 | ||
2232 | <span class="k">class</span> <span class="nc">ExampleAction</span> <span class="k">extends</span> <span class="nx">AbstractDatabaseObjectAction</span> <span class="p">{</span> | |
2233 | <span class="k">public</span> <span class="nv">$className</span> <span class="o">=</span> <span class="nx">ExampleEditor</span><span class="o">::</span><span class="na">class</span><span class="p">;</span> | |
2234 | <span class="p">}</span> | |
2235 | </code></pre></div> | |
45ca63d0 TD |
2236 | <h3 id="executing-an-action">Executing an Action<a class="headerlink" href="#executing-an-action" title="Permanent link">#</a></h3> |
2237 | <div class="admonition warning"> | |
2238 | <p class="admonition-title">The method <code>AbstractDatabaseObjectAction::validateAction()</code> is internally used for AJAX method invocation and must not be called programmatically.</p> | |
2239 | </div> | |
2240 | <p>The next example represents the same functionality as seen for <code>DatabaseObjectEditor</code>:</p> | |
2241 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2242 | <span class="k">use</span> <span class="nx">wcf\data\example\ExampleAction</span><span class="p">;</span> | |
2243 | ||
2244 | <span class="c1">// create a row</span> | |
2245 | <span class="nv">$exampleAction</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ExampleAction</span><span class="p">([],</span> <span class="s1">'create'</span><span class="p">,</span> <span class="p">[</span> | |
2246 | <span class="s1">'data'</span> <span class="o">=></span> <span class="p">[</span><span class="s1">'bar'</span> <span class="o">=></span> <span class="s1">'Hello World'</span><span class="p">]</span> | |
2247 | <span class="p">]);</span> | |
2248 | <span class="nv">$example</span> <span class="o">=</span> <span class="nv">$exampleAction</span><span class="o">-></span><span class="na">executeAction</span><span class="p">()[</span><span class="s1">'returnValues'</span><span class="p">];</span> | |
2249 | ||
2250 | <span class="c1">// update a row using the id</span> | |
2251 | <span class="nv">$exampleAction</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ExampleAction</span><span class="p">([</span><span class="mi">1</span><span class="p">],</span> <span class="s1">'update'</span><span class="p">,</span> <span class="p">[</span> | |
2252 | <span class="s1">'data'</span> <span class="o">=></span> <span class="p">[</span><span class="s1">'bar'</span> <span class="o">=></span> <span class="s1">'baz'</span><span class="p">]</span> | |
2253 | <span class="p">]);</span> | |
2254 | <span class="nv">$exampleAction</span><span class="o">-></span><span class="na">executeAction</span><span class="p">();</span> | |
2255 | ||
2256 | <span class="c1">// delete a row using a model</span> | |
2257 | <span class="nv">$exampleAction</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ExampleAction</span><span class="p">([</span><span class="nv">$example</span><span class="p">],</span> <span class="s1">'delete'</span><span class="p">);</span> | |
2258 | <span class="nv">$exampleAction</span><span class="o">-></span><span class="na">executeAction</span><span class="p">();</span> | |
2259 | </code></pre></div> | |
45ca63d0 TD |
2260 | <p>You can access the return values both by storing the return value of <code>executeAction()</code> or by retrieving it via <code>getReturnValues()</code>.</p> |
2261 | <p><span class="label label-info">Events</span> <code>initializeAction</code>, <code>validateAction</code> and <code>finalizeAction</code></p> | |
2262 | <h3 id="custom-method-with-ajax-support">Custom Method with AJAX Support<a class="headerlink" href="#custom-method-with-ajax-support" title="Permanent link">#</a></h3> | |
2263 | <p>This section is about adding the method <code>baz()</code> to <code>ExampleAction</code> and calling it via AJAX.</p> | |
2264 | <h4 id="ajax-validation">AJAX Validation<a class="headerlink" href="#ajax-validation" title="Permanent link">#</a></h4> | |
2265 | <p>Methods of an action cannot be called via AJAX, unless they have a validation method. This means that <code>ExampleAction</code> must define both a <code>public function baz()</code> and <code>public function validateBaz()</code>, the name for the validation method is constructed by upper-casing the first character of the method name and prepending <code>validate</code>.</p> | |
2266 | <p>The lack of the companion <code>validate*</code> method will cause the AJAX proxy to deny the request instantaneously. Do not add a validation method if you don't want it to be callable via AJAX ever!</p> | |
2267 | <h4 id="create-update-and-delete">create, update and delete<a class="headerlink" href="#create-update-and-delete" title="Permanent link">#</a></h4> | |
2268 | <p>The methods <code>create</code>, <code>update</code> and <code>delete</code> are available for all classes deriving from <code>AbstractDatabaseObjectAction</code> and directly pass the input data to the <code>DatabaseObjectEditor</code>. These methods deny access to them via AJAX by default, unless you explicitly enable access. Depending on your case, there are two different strategies to enable AJAX access to them.</p> | |
2269 | <div class="highlight"><pre><span></span><code><span class="o"><?</span><span class="nx">php</span> | |
2270 | <span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span> | |
2271 | <span class="k">use</span> <span class="nx">wcf\data\AbstractDatabaseObjectAction</span><span class="p">;</span> | |
2272 | ||
2273 | <span class="k">class</span> <span class="nc">ExampleAction</span> <span class="k">extends</span> <span class="nx">AbstractDatabaseObjectAction</span> <span class="p">{</span> | |
2274 | <span class="c1">// `create()` can now be called via AJAX if the requesting user posses the listed permissions</span> | |
2275 | <span class="k">protected</span> <span class="nv">$permissionsCreate</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'admin.example.canManageExample'</span><span class="p">];</span> | |
2276 | ||
2277 | <span class="k">public</span> <span class="k">function</span> <span class="nf">validateUpdate</span><span class="p">()</span> <span class="p">{</span> | |
2278 | <span class="c1">// your very own validation logic that does not make use of the</span> | |
2279 | <span class="c1">// built-in `$permissionsUpdate` property</span> | |
2280 | ||
2281 | <span class="c1">// you can still invoke the built-in permissions check if you like to</span> | |
2282 | <span class="k">parent</span><span class="o">::</span><span class="na">validateUpdate</span><span class="p">();</span> | |
2283 | <span class="p">}</span> | |
2284 | <span class="p">}</span> | |
2285 | </code></pre></div> | |
45ca63d0 TD |
2286 | <h4 id="allow-invokation-by-guests">Allow Invokation by Guests<a class="headerlink" href="#allow-invokation-by-guests" title="Permanent link">#</a></h4> |
2287 | <p>Invoking methods is restricted to logged-in users by default and the only way to override this behavior is to alter the property <code>$allowGuestAccess</code>. It is a simple string array that is expected to hold all methods that should be accessible by users, excluding their companion validation methods.</p> | |
2288 | <h4 id="acp-access-only">ACP Access Only<a class="headerlink" href="#acp-access-only" title="Permanent link">#</a></h4> | |
2289 | <p>Method access is usually limited by permissions, but sometimes there might be the need for some added security to avoid mistakes. The <code>$requireACP</code> property works similar to <code>$allowGuestAccess</code>, but enforces the request to originate from the ACP together with a valid ACP session, ensuring that only users able to access the ACP can actually invoke these methods.</p> | |
2290 | ||
4a5c32e1 WG |
2291 | |
2292 | ||
2293 | ||
2294 | <hr> | |
2295 | <div class="md-source-date"> | |
2296 | <small> | |
2297 | ||
2298 | Last update: 2021-02-11 | |
2299 | ||
2300 | </small> | |
2301 | </div> | |
2302 | ||
2303 | ||
45ca63d0 TD |
2304 | |
2305 | ||
2306 | ||
2307 | ||
2308 | ||
2309 | ||
2310 | </article> | |
2311 | </div> | |
2312 | </div> | |
fb962f09 | 2313 | |
45ca63d0 TD |
2314 | </main> |
2315 | ||
2316 | ||
2317 | <footer class="md-footer"> | |
2318 | ||
2319 | <nav class="md-footer__inner md-grid" aria-label="Footer"> | |
2320 | ||
2321 | <a href="../pages/" class="md-footer__link md-footer__link--prev" rel="prev"> | |
2322 | <div class="md-footer__button md-icon"> | |
2323 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg> | |
2324 | </div> | |
2325 | <div class="md-footer__title"> | |
2326 | <div class="md-ellipsis"> | |
2327 | <span class="md-footer__direction"> | |
2328 | Previous | |
2329 | </span> | |
2330 | Pages | |
2331 | </div> | |
2332 | </div> | |
2333 | </a> | |
2334 | ||
2335 | ||
2336 | <a href="../database-access/" class="md-footer__link md-footer__link--next" rel="next"> | |
2337 | <div class="md-footer__title"> | |
2338 | <div class="md-ellipsis"> | |
2339 | <span class="md-footer__direction"> | |
2340 | Next | |
2341 | </span> | |
2342 | Database Access | |
2343 | </div> | |
2344 | </div> | |
2345 | <div class="md-footer__button md-icon"> | |
2346 | <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg> | |
2347 | </div> | |
2348 | </a> | |
2349 | ||
2350 | </nav> | |
2351 | ||
2352 | <div class="md-footer-meta md-typeset"> | |
2353 | <div class="md-footer-meta__inner md-grid"> | |
2354 | <div class="md-footer-copyright"> | |
2355 | ||
2356 | <div class="md-footer-copyright__highlight"> | |
2357 | Copyright © 2020 WoltLab GmbH | |
2358 | </div> | |
2359 | ||
2360 | Made with | |
2361 | <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener"> | |
2362 | Material for MkDocs | |
2363 | </a> | |
fb88dc6e | 2364 | |
45ca63d0 TD |
2365 | </div> |
2366 | <div class="md-footer-copyright"> | |
2367 | <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a> | |
2368 | <a href="https://www.woltlab.com/privacy-policy/">Privacy Policy</a> | |
2369 | </div> | |
2370 | </div> | |
2371 | </div> | |
2372 | </footer> | |
2373 | ||
2374 | </div> | |
2375 | <div class="md-dialog" data-md-component="dialog"> | |
2376 | <div class="md-dialog__inner md-typeset"></div> | |
2377 | </div> | |
fb962f09 | 2378 | <script id="__config" type="application/json">{"base": "../..", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}, "search": "../../assets/javascripts/workers/search.fe42c31b.min.js", "version": {"provider": "mike"}}</script> |
45ca63d0 TD |
2379 | |
2380 | ||
fb962f09 | 2381 | <script src="../../assets/javascripts/bundle.d892486b.min.js"></script> |
45ca63d0 TD |
2382 | |
2383 | ||
2384 | </body> | |
2385 | </html> |