Deployed 30b0201 to 5.4 with MkDocs 1.1.2 and mike 1.0.0
[GitHub/WoltLab/woltlab.github.io.git] / 5.4 / php / database-objects / index.html
CommitLineData
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 12 <link rel="icon" href="../../assets/default.favicon.ico">
a4835aa6 13 <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.1.2">
45ca63d0
TD
14
15
16
17 <title>Database Objects - WoltLab Suite Documentation</title>
18
19
20
a4835aa6 21 <link rel="stylesheet" href="../../assets/stylesheets/main.6f955dcd.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
a4835aa6 260
45ca63d0
TD
261
262
263
264 <label class="md-nav__link md-nav__link--active" for="__toc">
265 Database Objects
266 <span class="md-nav__icon md-icon"></span>
267 </label>
268
269 <a href="./" class="md-nav__link md-nav__link--active">
270 Database Objects
271 </a>
272
273
274<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
275
276
a4835aa6 277
45ca63d0
TD
278
279
280
281 <label class="md-nav__title" for="__toc">
282 <span class="md-nav__icon md-icon"></span>
283 Table of contents
284 </label>
285 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
286
287 <li class="md-nav__item">
288 <a href="#databaseobject" class="md-nav__link">
289 DatabaseObject
290 </a>
291
292</li>
293
294 <li class="md-nav__item">
295 <a href="#databaseobjectdecorator" class="md-nav__link">
296 DatabaseObjectDecorator
297 </a>
298
299</li>
300
301 <li class="md-nav__item">
302 <a href="#databaseobjecteditor" class="md-nav__link">
303 DatabaseObjectEditor
304 </a>
305
306 <nav class="md-nav" aria-label="DatabaseObjectEditor">
307 <ul class="md-nav__list">
308
309 <li class="md-nav__item">
310 <a href="#create-a-new-row" class="md-nav__link">
311 Create a new row
312 </a>
313
314</li>
315
316 <li class="md-nav__item">
317 <a href="#updating-an-existing-row" class="md-nav__link">
318 Updating an existing row
319 </a>
320
321</li>
322
323 <li class="md-nav__item">
324 <a href="#deleting-a-row" class="md-nav__link">
325 Deleting a row
326 </a>
327
328</li>
329
330 </ul>
331 </nav>
332
333</li>
334
335 <li class="md-nav__item">
336 <a href="#databaseobjectlist" class="md-nav__link">
337 DatabaseObjectList
338 </a>
339
340</li>
341
342 <li class="md-nav__item">
343 <a href="#abstractdatabaseobjectaction" class="md-nav__link">
344 AbstractDatabaseObjectAction
345 </a>
346
347 <nav class="md-nav" aria-label="AbstractDatabaseObjectAction">
348 <ul class="md-nav__list">
349
350 <li class="md-nav__item">
351 <a href="#executing-an-action" class="md-nav__link">
352 Executing an Action
353 </a>
354
355</li>
356
357 <li class="md-nav__item">
358 <a href="#custom-method-with-ajax-support" class="md-nav__link">
359 Custom Method with AJAX Support
360 </a>
361
362 <nav class="md-nav" aria-label="Custom Method with AJAX Support">
363 <ul class="md-nav__list">
364
365 <li class="md-nav__item">
366 <a href="#ajax-validation" class="md-nav__link">
367 AJAX Validation
368 </a>
369
370</li>
371
372 <li class="md-nav__item">
373 <a href="#create-update-and-delete" class="md-nav__link">
374 create, update and delete
375 </a>
376
377</li>
378
379 <li class="md-nav__item">
380 <a href="#allow-invokation-by-guests" class="md-nav__link">
381 Allow Invokation by Guests
382 </a>
383
384</li>
385
386 <li class="md-nav__item">
387 <a href="#acp-access-only" class="md-nav__link">
388 ACP Access Only
389 </a>
390
391</li>
392
393 </ul>
394 </nav>
395
396</li>
397
398 </ul>
399 </nav>
400
401</li>
402
403 </ul>
404
405</nav>
406
407 </li>
408
409
410
411
412
413
414
415 <li class="md-nav__item">
416 <a href="../database-access/" class="md-nav__link">
417 Database Access
418 </a>
419 </li>
420
421
422
423
424
425
426
427 <li class="md-nav__item">
428 <a href="../exceptions/" class="md-nav__link">
429 Exceptions
430 </a>
431 </li>
432
433
434
435
436
437
438
439
440 <li class="md-nav__item md-nav__item--nested">
441
442
443 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5" type="checkbox" id="__nav_2_5" >
444
445 <label class="md-nav__link" for="__nav_2_5">
446 API
447 <span class="md-nav__icon md-icon"></span>
448 </label>
449 <nav class="md-nav" aria-label="API" data-md-level="2">
450 <label class="md-nav__title" for="__nav_2_5">
451 <span class="md-nav__icon md-icon"></span>
452 API
453 </label>
454 <ul class="md-nav__list" data-md-scrollfix>
455
456
457
458
459
6923e968
WG
460
461 <li class="md-nav__item md-nav__item--nested">
462
463
464 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5_1" type="checkbox" id="__nav_2_5_1" >
465
466 <label class="md-nav__link" for="__nav_2_5_1">
467 Caches
468 <span class="md-nav__icon md-icon"></span>
469 </label>
470 <nav class="md-nav" aria-label="Caches" data-md-level="3">
471 <label class="md-nav__title" for="__nav_2_5_1">
472 <span class="md-nav__icon md-icon"></span>
473 Caches
474 </label>
475 <ul class="md-nav__list" data-md-scrollfix>
476
477
478
479
480
45ca63d0
TD
481 <li class="md-nav__item">
482 <a href="../api/caches/" class="md-nav__link">
6923e968
WG
483 Overview
484 </a>
485 </li>
486
487
488
489
490
491
492
493 <li class="md-nav__item">
494 <a href="../api/caches_persistent-caches/" class="md-nav__link">
495 Persistent Caches
496 </a>
497 </li>
498
499
500
501
502
503
504
505 <li class="md-nav__item">
506 <a href="../api/caches_runtime-caches/" class="md-nav__link">
507 Runtime Caches
45ca63d0
TD
508 </a>
509 </li>
510
511
512
6923e968
WG
513 </ul>
514 </nav>
515 </li>
516
517
518
45ca63d0
TD
519
520
521
522
523 <li class="md-nav__item">
524 <a href="../api/comments/" class="md-nav__link">
525 Comments
526 </a>
527 </li>
528
529
530
531
532
533
534
535 <li class="md-nav__item">
536 <a href="../api/cronjobs/" class="md-nav__link">
537 Cronjobs
538 </a>
539 </li>
540
541
542
543
544
545
546
547 <li class="md-nav__item">
548 <a href="../api/events/" class="md-nav__link">
549 Events
550 </a>
551 </li>
552
553
554
555
556
557
558
559
560 <li class="md-nav__item md-nav__item--nested">
561
562
563 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5_5" type="checkbox" id="__nav_2_5_5" >
564
565 <label class="md-nav__link" for="__nav_2_5_5">
566 Form Builder
567 <span class="md-nav__icon md-icon"></span>
568 </label>
569 <nav class="md-nav" aria-label="Form Builder" data-md-level="3">
570 <label class="md-nav__title" for="__nav_2_5_5">
571 <span class="md-nav__icon md-icon"></span>
572 Form Builder
573 </label>
574 <ul class="md-nav__list" data-md-scrollfix>
575
576
577
578
579
580 <li class="md-nav__item">
581 <a href="../api/form_builder/overview/" class="md-nav__link">
582 Overview
583 </a>
584 </li>
585
586
587
588
589
590
591
592 <li class="md-nav__item">
593 <a href="../api/form_builder/structure/" class="md-nav__link">
594 Structure
595 </a>
596 </li>
597
598
599
600
601
602
603
604 <li class="md-nav__item">
605 <a href="../api/form_builder/form_fields/" class="md-nav__link">
606 Fields
607 </a>
608 </li>
609
610
611
612
613
614
615
616 <li class="md-nav__item">
617 <a href="../api/form_builder/validation_data/" class="md-nav__link">
618 Validation and Data
619 </a>
620 </li>
621
622
623
624
625
626
627
628 <li class="md-nav__item">
629 <a href="../api/form_builder/dependencies/" class="md-nav__link">
630 Dependencies
631 </a>
632 </li>
633
634
635
636 </ul>
637 </nav>
638 </li>
639
640
641
642
643
644
645
646 <li class="md-nav__item">
647 <a href="../api/package_installation_plugins/" class="md-nav__link">
648 Package Installation Plugins
649 </a>
650 </li>
651
652
653
654
655
656
657
658 <li class="md-nav__item">
659 <a href="../api/user_activity_points/" class="md-nav__link">
660 User Activity Points
661 </a>
662 </li>
663
664
665
666
667
668
669
670 <li class="md-nav__item">
671 <a href="../api/user_notifications/" class="md-nav__link">
672 User Notifications
673 </a>
674 </li>
675
676
677
678
679
680
681
682 <li class="md-nav__item">
683 <a href="../api/sitemaps/" class="md-nav__link">
684 Sitemaps
685 </a>
686 </li>
687
688
689
690 </ul>
691 </nav>
692 </li>
693
694
695
696
697
698
699
700 <li class="md-nav__item">
701 <a href="../code-style/" class="md-nav__link">
702 Code Style
703 </a>
704 </li>
705
706
707
708
709
710
711
712 <li class="md-nav__item">
713 <a href="../apps/" class="md-nav__link">
714 Apps
715 </a>
716 </li>
717
718
719
720
721
722
723
724 <li class="md-nav__item">
725 <a href="../gdpr/" class="md-nav__link">
726 GDPR
727 </a>
728 </li>
729
730
731
732 </ul>
733 </nav>
734 </li>
735
736
737
738
739
740
741
742
743
744
745
746 <li class="md-nav__item md-nav__item--nested">
747
748
749 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
750
751 <label class="md-nav__link" for="__nav_3">
752 Languages, Templates & CSS
753 <span class="md-nav__icon md-icon"></span>
754 </label>
755 <nav class="md-nav" aria-label="Languages, Templates & CSS" data-md-level="1">
756 <label class="md-nav__title" for="__nav_3">
757 <span class="md-nav__icon md-icon"></span>
758 Languages, Templates & CSS
759 </label>
760 <ul class="md-nav__list" data-md-scrollfix>
761
762
763
764
765
766 <li class="md-nav__item">
767 <a href="../../view/languages/" class="md-nav__link">
768 Languages
769 </a>
770 </li>
771
772
773
774
775
776
777
778 <li class="md-nav__item">
779 <a href="../../view/templates/" class="md-nav__link">
780 Templates
781 </a>
782 </li>
783
784
785
786
787
788
789
6923e968
WG
790 <li class="md-nav__item">
791 <a href="../../view/template-plugins/" class="md-nav__link">
792 Template Plugins
793 </a>
794 </li>
795
796
797
798
799
800
801
45ca63d0
TD
802 <li class="md-nav__item">
803 <a href="../../view/css/" class="md-nav__link">
804 CSS
805 </a>
806 </li>
807
808
809
810 </ul>
811 </nav>
812 </li>
813
814
815
816
817
818
819
820
821
822
823
824 <li class="md-nav__item md-nav__item--nested">
825
826
827 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
828
829 <label class="md-nav__link" for="__nav_4">
77efcd46 830 TypeScript and JavaScript API
45ca63d0
TD
831 <span class="md-nav__icon md-icon"></span>
832 </label>
77efcd46 833 <nav class="md-nav" aria-label="TypeScript and JavaScript API" data-md-level="1">
45ca63d0
TD
834 <label class="md-nav__title" for="__nav_4">
835 <span class="md-nav__icon md-icon"></span>
77efcd46 836 TypeScript and JavaScript API
45ca63d0
TD
837 </label>
838 <ul class="md-nav__list" data-md-scrollfix>
839
840
841
842
843
844 <li class="md-nav__item">
845 <a href="../../javascript/general-usage/" class="md-nav__link">
846 General Usage
847 </a>
848 </li>
849
850
851
852
853
854
855
77efcd46
WG
856 <li class="md-nav__item">
857 <a href="../../javascript/typescript/" class="md-nav__link">
858 TypeScript
859 </a>
860 </li>
861
862
863
864
865
866
867
45ca63d0
TD
868
869 <li class="md-nav__item md-nav__item--nested">
870
871
77efcd46 872 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_3" type="checkbox" id="__nav_4_3" >
45ca63d0 873
77efcd46 874 <label class="md-nav__link" for="__nav_4_3">
45ca63d0
TD
875 New API
876 <span class="md-nav__icon md-icon"></span>
877 </label>
878 <nav class="md-nav" aria-label="New API" data-md-level="2">
77efcd46 879 <label class="md-nav__title" for="__nav_4_3">
45ca63d0
TD
880 <span class="md-nav__icon md-icon"></span>
881 New API
882 </label>
883 <ul class="md-nav__list" data-md-scrollfix>
884
885
886
887
888
889 <li class="md-nav__item">
890 <a href="../../javascript/new-api_writing-a-module/" class="md-nav__link">
891 Writing a module
892 </a>
893 </li>
894
895
896
897
898
899
900
901 <li class="md-nav__item">
902 <a href="../../javascript/new-api_data-structures/" class="md-nav__link">
903 Data Structures
904 </a>
905 </li>
906
907
908
909
910
911
912
913 <li class="md-nav__item">
914 <a href="../../javascript/new-api_core/" class="md-nav__link">
915 Core Functions
916 </a>
917 </li>
918
919
920
921
922
923
924
925 <li class="md-nav__item">
926 <a href="../../javascript/new-api_dom/" class="md-nav__link">
927 DOM
928 </a>
929 </li>
930
931
932
933
934
935
936
937 <li class="md-nav__item">
938 <a href="../../javascript/new-api_events/" class="md-nav__link">
939 Event Handling
940 </a>
941 </li>
942
943
944
945
946
947
948
949 <li class="md-nav__item">
950 <a href="../../javascript/new-api_ajax/" class="md-nav__link">
951 Ajax
952 </a>
953 </li>
954
955
956
957
958
959
960
961 <li class="md-nav__item">
962 <a href="../../javascript/new-api_dialogs/" class="md-nav__link">
963 Dialogs
964 </a>
965 </li>
966
967
968
969
970
971
972
973 <li class="md-nav__item">
974 <a href="../../javascript/new-api_browser/" class="md-nav__link">
975 Browser and Screen Sizes
976 </a>
977 </li>
978
979
980
981
982
983
984
985 <li class="md-nav__item">
986 <a href="../../javascript/new-api_ui/" class="md-nav__link">
987 User Interface
988 </a>
989 </li>
990
991
992
993 </ul>
994 </nav>
995 </li>
996
997
998
999
1000
1001
1002
1003 <li class="md-nav__item">
1004 <a href="../../javascript/legacy-api/" class="md-nav__link">
1005 Legacy API
1006 </a>
1007 </li>
1008
1009
1010
1011
1012
1013
1014
1015 <li class="md-nav__item">
1016 <a href="../../javascript/helper-functions/" class="md-nav__link">
1017 Helper Functions
1018 </a>
1019 </li>
1020
1021
1022
1023
1024
1025
1026
1027 <li class="md-nav__item">
1028 <a href="../../javascript/code-snippets/" class="md-nav__link">
1029 Code Snippets
1030 </a>
1031 </li>
1032
1033
1034
1035 </ul>
1036 </nav>
1037 </li>
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049 <li class="md-nav__item md-nav__item--nested">
1050
1051
1052 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
1053
1054 <label class="md-nav__link" for="__nav_5">
1055 Package Components
1056 <span class="md-nav__icon md-icon"></span>
1057 </label>
1058 <nav class="md-nav" aria-label="Package Components" data-md-level="1">
1059 <label class="md-nav__title" for="__nav_5">
1060 <span class="md-nav__icon md-icon"></span>
1061 Package Components
1062 </label>
1063 <ul class="md-nav__list" data-md-scrollfix>
1064
1065
1066
1067
1068
1069 <li class="md-nav__item">
1070 <a href="../../package/package-xml/" class="md-nav__link">
1071 package.xml
1072 </a>
1073 </li>
1074
1075
1076
1077
1078
1079
1080
1081
1082 <li class="md-nav__item md-nav__item--nested">
1083
1084
1085 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" >
1086
1087 <label class="md-nav__link" for="__nav_5_2">
1088 PIPs
1089 <span class="md-nav__icon md-icon"></span>
1090 </label>
1091 <nav class="md-nav" aria-label="PIPs" data-md-level="2">
1092 <label class="md-nav__title" for="__nav_5_2">
1093 <span class="md-nav__icon md-icon"></span>
1094 PIPs
1095 </label>
1096 <ul class="md-nav__list" data-md-scrollfix>
1097
1098
1099
1100
1101
1102 <li class="md-nav__item">
1103 <a href="../../package/pip/" class="md-nav__link">
1104 Overview
1105 </a>
1106 </li>
1107
1108
1109
1110
1111
1112
1113
1114 <li class="md-nav__item">
1115 <a href="../../package/pip/acl-option/" class="md-nav__link">
1116 aclOption
1117 </a>
1118 </li>
1119
1120
1121
1122
1123
1124
1125
1126 <li class="md-nav__item">
1127 <a href="../../package/pip/acp-menu/" class="md-nav__link">
1128 acpMenu
1129 </a>
1130 </li>
1131
1132
1133
1134
1135
1136
1137
1138 <li class="md-nav__item">
1139 <a href="../../package/pip/acp-search-provider/" class="md-nav__link">
1140 acpSearchProvider
1141 </a>
1142 </li>
1143
1144
1145
1146
1147
1148
1149
1150 <li class="md-nav__item">
1151 <a href="../../package/pip/acp-template/" class="md-nav__link">
1152 acpTemplate
1153 </a>
1154 </li>
1155
1156
1157
1158
1159
1160
1161
1162 <li class="md-nav__item">
1163 <a href="../../package/pip/bbcode/" class="md-nav__link">
1164 bbcode
1165 </a>
1166 </li>
1167
1168
1169
1170
1171
1172
1173
1174 <li class="md-nav__item">
1175 <a href="../../package/pip/box/" class="md-nav__link">
1176 box
1177 </a>
1178 </li>
1179
1180
1181
1182
1183
1184
1185
1186 <li class="md-nav__item">
1187 <a href="../../package/pip/clipboard-action/" class="md-nav__link">
1188 clipboardAction
1189 </a>
1190 </li>
1191
1192
1193
1194
1195
1196
1197
1198 <li class="md-nav__item">
1199 <a href="../../package/pip/core-object/" class="md-nav__link">
1200 coreObject
1201 </a>
1202 </li>
1203
1204
1205
1206
1207
1208
1209
1210 <li class="md-nav__item">
1211 <a href="../../package/pip/cronjob/" class="md-nav__link">
1212 cronjob
1213 </a>
1214 </li>
1215
1216
1217
1218
1219
1220
1221
6923e968
WG
1222 <li class="md-nav__item">
1223 <a href="../../package/pip/database/" class="md-nav__link">
1224 database
1225 </a>
1226 </li>
1227
1228
1229
1230
1231
1232
1233
45ca63d0
TD
1234 <li class="md-nav__item">
1235 <a href="../../package/pip/event-listener/" class="md-nav__link">
1236 eventListener
1237 </a>
1238 </li>
1239
1240
1241
1242
1243
1244
1245
1246 <li class="md-nav__item">
1247 <a href="../../package/pip/file/" class="md-nav__link">
1248 file
1249 </a>
1250 </li>
1251
1252
1253
1254
1255
1256
1257
1258 <li class="md-nav__item">
1259 <a href="../../package/pip/language/" class="md-nav__link">
1260 language
1261 </a>
1262 </li>
1263
1264
1265
1266
1267
1268
1269
1270 <li class="md-nav__item">
1271 <a href="../../package/pip/media-provider/" class="md-nav__link">
1272 mediaProvider
1273 </a>
1274 </li>
1275
1276
1277
1278
1279
1280
1281
1282 <li class="md-nav__item">
1283 <a href="../../package/pip/menu/" class="md-nav__link">
1284 menu
1285 </a>
1286 </li>
1287
1288
1289
1290
1291
1292
1293
1294 <li class="md-nav__item">
1295 <a href="../../package/pip/menu-item/" class="md-nav__link">
1296 menuItem
1297 </a>
1298 </li>
1299
1300
1301
1302
1303
1304
1305
1306 <li class="md-nav__item">
1307 <a href="../../package/pip/object-type/" class="md-nav__link">
1308 objectType
1309 </a>
1310 </li>
1311
1312
1313
1314
1315
1316
1317
1318 <li class="md-nav__item">
1319 <a href="../../package/pip/object-type-definition/" class="md-nav__link">
1320 objectTypeDefinition
1321 </a>
1322 </li>
1323
1324
1325
1326
1327
1328
1329
1330 <li class="md-nav__item">
1331 <a href="../../package/pip/option/" class="md-nav__link">
1332 option
1333 </a>
1334 </li>
1335
1336
1337
1338
1339
1340
1341
1342 <li class="md-nav__item">
1343 <a href="../../package/pip/page/" class="md-nav__link">
1344 page
1345 </a>
1346 </li>
1347
1348
1349
1350
1351
1352
1353
1354 <li class="md-nav__item">
1355 <a href="../../package/pip/pip/" class="md-nav__link">
1356 pip
1357 </a>
1358 </li>
1359
1360
1361
1362
1363
1364
1365
1366 <li class="md-nav__item">
1367 <a href="../../package/pip/script/" class="md-nav__link">
1368 script
1369 </a>
1370 </li>
1371
1372
1373
1374
1375
1376
1377
1378 <li class="md-nav__item">
1379 <a href="../../package/pip/smiley/" class="md-nav__link">
1380 smiley
1381 </a>
1382 </li>
1383
1384
1385
1386
1387
1388
1389
1390 <li class="md-nav__item">
1391 <a href="../../package/pip/sql/" class="md-nav__link">
1392 sql
1393 </a>
1394 </li>
1395
1396
1397
1398
1399
1400
1401
1402 <li class="md-nav__item">
1403 <a href="../../package/pip/style/" class="md-nav__link">
1404 style
1405 </a>
1406 </li>
1407
1408
1409
1410
1411
1412
1413
1414 <li class="md-nav__item">
1415 <a href="../../package/pip/template/" class="md-nav__link">
1416 template
1417 </a>
1418 </li>
1419
1420
1421
1422
1423
1424
1425
1426 <li class="md-nav__item">
1427 <a href="../../package/pip/template-listener/" class="md-nav__link">
1428 templateListener
1429 </a>
1430 </li>
1431
1432
1433
1434
1435
1436
1437
1438 <li class="md-nav__item">
1439 <a href="../../package/pip/user-group-option/" class="md-nav__link">
1440 userGroupOption
1441 </a>
1442 </li>
1443
1444
1445
1446
1447
1448
1449
1450 <li class="md-nav__item">
1451 <a href="../../package/pip/user-menu/" class="md-nav__link">
1452 userMenu
1453 </a>
1454 </li>
1455
1456
1457
1458
1459
1460
1461
1462 <li class="md-nav__item">
1463 <a href="../../package/pip/user-notification-event/" class="md-nav__link">
1464 userNotificationEvent
1465 </a>
1466 </li>
1467
1468
1469
1470
1471
1472
1473
1474 <li class="md-nav__item">
1475 <a href="../../package/pip/user-option/" class="md-nav__link">
1476 userOption
1477 </a>
1478 </li>
1479
1480
1481
1482
1483
1484
1485
1486 <li class="md-nav__item">
1487 <a href="../../package/pip/user-profile-menu/" class="md-nav__link">
1488 userProfileMenu
1489 </a>
1490 </li>
1491
1492
1493
1494 </ul>
1495 </nav>
1496 </li>
1497
1498
1499
1500
1501
1502
1503
1504 <li class="md-nav__item">
1505 <a href="../../package/database-php-api/" class="md-nav__link">
1506 Database PHP API
1507 </a>
1508 </li>
1509
1510
1511
1512 </ul>
1513 </nav>
1514 </li>
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526 <li class="md-nav__item md-nav__item--nested">
1527
1528
1529 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
1530
1531 <label class="md-nav__link" for="__nav_6">
1532 Migration
1533 <span class="md-nav__icon md-icon"></span>
1534 </label>
1535 <nav class="md-nav" aria-label="Migration" data-md-level="1">
1536 <label class="md-nav__title" for="__nav_6">
1537 <span class="md-nav__icon md-icon"></span>
1538 Migration
1539 </label>
1540 <ul class="md-nav__list" data-md-scrollfix>
1541
1542
1543
1544
1545
1546
1547 <li class="md-nav__item md-nav__item--nested">
1548
1549
1550 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_1" type="checkbox" id="__nav_6_1" >
1551
1552 <label class="md-nav__link" for="__nav_6_1">
1553 Migrating from WSC 5.3
1554 <span class="md-nav__icon md-icon"></span>
1555 </label>
1556 <nav class="md-nav" aria-label="Migrating from WSC 5.3" data-md-level="2">
1557 <label class="md-nav__title" for="__nav_6_1">
1558 <span class="md-nav__icon md-icon"></span>
1559 Migrating from WSC 5.3
1560 </label>
1561 <ul class="md-nav__list" data-md-scrollfix>
1562
1563
1564
1565
1566
1567 <li class="md-nav__item">
1568 <a href="../../migration/wsc53/php/" class="md-nav__link">
1569 PHP API
1570 </a>
1571 </li>
1572
1573
1574
1575
1576
1577
1578
1579 <li class="md-nav__item">
1580 <a href="../../migration/wsc53/session/" class="md-nav__link">
1581 Session Handling and Authentication
1582 </a>
1583 </li>
1584
1585
1586
1587
1588
1589
1590
1591 <li class="md-nav__item">
1592 <a href="../../migration/wsc53/javascript/" class="md-nav__link">
77efcd46 1593 TypeScript and JavaScript
45ca63d0
TD
1594 </a>
1595 </li>
1596
1597
1598
1599
1600
1601
1602
1603 <li class="md-nav__item">
1604 <a href="../../migration/wsc53/templates/" class="md-nav__link">
1605 Templates
1606 </a>
1607 </li>
1608
1609
1610
1611
1612
1613
1614
1615 <li class="md-nav__item">
1616 <a href="../../migration/wsc53/libraries/" class="md-nav__link">
1617 Third Party Libraries
1618 </a>
1619 </li>
1620
1621
1622
1623 </ul>
1624 </nav>
1625 </li>
1626
1627
1628
1629
1630
1631
1632
1633
1634 <li class="md-nav__item md-nav__item--nested">
1635
1636
1637 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_2" type="checkbox" id="__nav_6_2" >
1638
1639 <label class="md-nav__link" for="__nav_6_2">
1640 Migrating from WSC 5.2
1641 <span class="md-nav__icon md-icon"></span>
1642 </label>
1643 <nav class="md-nav" aria-label="Migrating from WSC 5.2" data-md-level="2">
1644 <label class="md-nav__title" for="__nav_6_2">
1645 <span class="md-nav__icon md-icon"></span>
1646 Migrating from WSC 5.2
1647 </label>
1648 <ul class="md-nav__list" data-md-scrollfix>
1649
1650
1651
1652
1653
1654 <li class="md-nav__item">
1655 <a href="../../migration/wsc52/php/" class="md-nav__link">
1656 PHP API
1657 </a>
1658 </li>
1659
1660
1661
1662
1663
1664
1665
1666 <li class="md-nav__item">
1667 <a href="../../migration/wsc52/templates/" class="md-nav__link">
1668 Templates and Languages
1669 </a>
1670 </li>
1671
1672
1673
1674
1675
1676
1677
1678 <li class="md-nav__item">
1679 <a href="../../migration/wsc52/libraries/" class="md-nav__link">
1680 Third Party Libraries
1681 </a>
1682 </li>
1683
1684
1685
1686 </ul>
1687 </nav>
1688 </li>
1689
1690
1691
1692
1693
1694
1695
1696
1697 <li class="md-nav__item md-nav__item--nested">
1698
1699
1700 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_3" type="checkbox" id="__nav_6_3" >
1701
1702 <label class="md-nav__link" for="__nav_6_3">
1703 Migrating from WSC 3.1
1704 <span class="md-nav__icon md-icon"></span>
1705 </label>
1706 <nav class="md-nav" aria-label="Migrating from WSC 3.1" data-md-level="2">
1707 <label class="md-nav__title" for="__nav_6_3">
1708 <span class="md-nav__icon md-icon"></span>
1709 Migrating from WSC 3.1
1710 </label>
1711 <ul class="md-nav__list" data-md-scrollfix>
1712
1713
1714
1715
1716
1717 <li class="md-nav__item">
1718 <a href="../../migration/wsc31/php/" class="md-nav__link">
1719 PHP API
1720 </a>
1721 </li>
1722
1723
1724
1725 </ul>
1726 </nav>
1727 </li>
1728
1729
1730
1731
1732
1733
1734
1735
1736 <li class="md-nav__item md-nav__item--nested">
1737
1738
1739 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_4" type="checkbox" id="__nav_6_4" >
1740
1741 <label class="md-nav__link" for="__nav_6_4">
1742 Migrating from WSC 3.0
1743 <span class="md-nav__icon md-icon"></span>
1744 </label>
1745 <nav class="md-nav" aria-label="Migrating from WSC 3.0" data-md-level="2">
1746 <label class="md-nav__title" for="__nav_6_4">
1747 <span class="md-nav__icon md-icon"></span>
1748 Migrating from WSC 3.0
1749 </label>
1750 <ul class="md-nav__list" data-md-scrollfix>
1751
1752
1753
1754
1755
1756 <li class="md-nav__item">
1757 <a href="../../migration/wsc30/php/" class="md-nav__link">
1758 PHP API
1759 </a>
1760 </li>
1761
1762
1763
1764
1765
1766
1767
1768 <li class="md-nav__item">
1769 <a href="../../migration/wsc30/javascript/" class="md-nav__link">
1770 JavaScript API
1771 </a>
1772 </li>
1773
1774
1775
1776
1777
1778
1779
1780 <li class="md-nav__item">
1781 <a href="../../migration/wsc30/templates/" class="md-nav__link">
1782 Templates
1783 </a>
1784 </li>
1785
1786
1787
1788
1789
1790
1791
1792 <li class="md-nav__item">
1793 <a href="../../migration/wsc30/css/" class="md-nav__link">
1794 CSS
1795 </a>
1796 </li>
1797
1798
1799
1800
1801
1802
1803
1804 <li class="md-nav__item">
1805 <a href="../../migration/wsc30/package/" class="md-nav__link">
1806 Package Components
1807 </a>
1808 </li>
1809
1810
1811
1812 </ul>
1813 </nav>
1814 </li>
1815
1816
1817
1818
1819
1820
1821
1822
1823 <li class="md-nav__item md-nav__item--nested">
1824
1825
1826 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_5" type="checkbox" id="__nav_6_5" >
1827
1828 <label class="md-nav__link" for="__nav_6_5">
1829 Migrating from WCF 2.1
1830 <span class="md-nav__icon md-icon"></span>
1831 </label>
1832 <nav class="md-nav" aria-label="Migrating from WCF 2.1" data-md-level="2">
1833 <label class="md-nav__title" for="__nav_6_5">
1834 <span class="md-nav__icon md-icon"></span>
1835 Migrating from WCF 2.1
1836 </label>
1837 <ul class="md-nav__list" data-md-scrollfix>
1838
1839
1840
1841
1842
1843 <li class="md-nav__item">
1844 <a href="../../migration/wcf21/php/" class="md-nav__link">
1845 PHP API
1846 </a>
1847 </li>
1848
1849
1850
1851
1852
1853
1854
1855 <li class="md-nav__item">
1856 <a href="../../migration/wcf21/templates/" class="md-nav__link">
1857 Templates
1858 </a>
1859 </li>
1860
1861
1862
1863
1864
1865
1866
1867 <li class="md-nav__item">
1868 <a href="../../migration/wcf21/css/" class="md-nav__link">
1869 CSS
1870 </a>
1871 </li>
1872
1873
1874
1875
1876
1877
1878
1879 <li class="md-nav__item">
1880 <a href="../../migration/wcf21/package/" class="md-nav__link">
1881 Package Components
1882 </a>
1883 </li>
1884
1885
1886
1887 </ul>
1888 </nav>
1889 </li>
1890
1891
1892
1893 </ul>
1894 </nav>
1895 </li>
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907 <li class="md-nav__item md-nav__item--nested">
1908
1909
1910 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
1911
1912 <label class="md-nav__link" for="__nav_7">
1913 Tutorials
1914 <span class="md-nav__icon md-icon"></span>
1915 </label>
1916 <nav class="md-nav" aria-label="Tutorials" data-md-level="1">
1917 <label class="md-nav__title" for="__nav_7">
1918 <span class="md-nav__icon md-icon"></span>
1919 Tutorials
1920 </label>
1921 <ul class="md-nav__list" data-md-scrollfix>
1922
1923
1924
1925
1926
1927
1928 <li class="md-nav__item md-nav__item--nested">
1929
1930
1931 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_1" type="checkbox" id="__nav_7_1" >
1932
1933 <label class="md-nav__link" for="__nav_7_1">
1934 Tutorial Series
1935 <span class="md-nav__icon md-icon"></span>
1936 </label>
1937 <nav class="md-nav" aria-label="Tutorial Series" data-md-level="2">
1938 <label class="md-nav__title" for="__nav_7_1">
1939 <span class="md-nav__icon md-icon"></span>
1940 Tutorial Series
1941 </label>
1942 <ul class="md-nav__list" data-md-scrollfix>
1943
1944
1945
1946
1947
1948 <li class="md-nav__item">
1949 <a href="../../tutorial/series/overview/" class="md-nav__link">
1950 Overview
1951 </a>
1952 </li>
1953
1954
1955
1956
1957
1958
1959
1960 <li class="md-nav__item">
1961 <a href="../../tutorial/series/part_1/" class="md-nav__link">
1962 Part 1
1963 </a>
1964 </li>
1965
1966
1967
1968
1969
1970
1971
1972 <li class="md-nav__item">
1973 <a href="../../tutorial/series/part_2/" class="md-nav__link">
1974 Part 2
1975 </a>
1976 </li>
1977
1978
1979
1980
1981
1982
1983
1984 <li class="md-nav__item">
1985 <a href="../../tutorial/series/part_3/" class="md-nav__link">
1986 Part 3
1987 </a>
1988 </li>
1989
1990
1991
41eda543
WG
1992
1993
1994
1995
1996 <li class="md-nav__item">
1997 <a href="../../tutorial/series/part_4/" class="md-nav__link">
1998 Part 4
1999 </a>
2000 </li>
2001
2002
2003
716a4ab6
WG
2004
2005
2006
2007
2008 <li class="md-nav__item">
2009 <a href="../../tutorial/series/part_5/" class="md-nav__link">
2010 Part 5
2011 </a>
2012 </li>
2013
2014
2015
45ca63d0
TD
2016 </ul>
2017 </nav>
2018 </li>
2019
2020
2021
2022 </ul>
2023 </nav>
2024 </li>
2025
2026
2027
2028 </ul>
2029</nav>
2030 </div>
2031 </div>
2032 </div>
2033
2034
2035
2036 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
2037 <div class="md-sidebar__scrollwrap">
2038 <div class="md-sidebar__inner">
2039
2040<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
2041
2042
a4835aa6 2043
45ca63d0
TD
2044
2045
2046
2047 <label class="md-nav__title" for="__toc">
2048 <span class="md-nav__icon md-icon"></span>
2049 Table of contents
2050 </label>
2051 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
2052
2053 <li class="md-nav__item">
2054 <a href="#databaseobject" class="md-nav__link">
2055 DatabaseObject
2056 </a>
2057
2058</li>
2059
2060 <li class="md-nav__item">
2061 <a href="#databaseobjectdecorator" class="md-nav__link">
2062 DatabaseObjectDecorator
2063 </a>
2064
2065</li>
2066
2067 <li class="md-nav__item">
2068 <a href="#databaseobjecteditor" class="md-nav__link">
2069 DatabaseObjectEditor
2070 </a>
2071
2072 <nav class="md-nav" aria-label="DatabaseObjectEditor">
2073 <ul class="md-nav__list">
2074
2075 <li class="md-nav__item">
2076 <a href="#create-a-new-row" class="md-nav__link">
2077 Create a new row
2078 </a>
2079
2080</li>
2081
2082 <li class="md-nav__item">
2083 <a href="#updating-an-existing-row" class="md-nav__link">
2084 Updating an existing row
2085 </a>
2086
2087</li>
2088
2089 <li class="md-nav__item">
2090 <a href="#deleting-a-row" class="md-nav__link">
2091 Deleting a row
2092 </a>
2093
2094</li>
2095
2096 </ul>
2097 </nav>
2098
2099</li>
2100
2101 <li class="md-nav__item">
2102 <a href="#databaseobjectlist" class="md-nav__link">
2103 DatabaseObjectList
2104 </a>
2105
2106</li>
2107
2108 <li class="md-nav__item">
2109 <a href="#abstractdatabaseobjectaction" class="md-nav__link">
2110 AbstractDatabaseObjectAction
2111 </a>
2112
2113 <nav class="md-nav" aria-label="AbstractDatabaseObjectAction">
2114 <ul class="md-nav__list">
2115
2116 <li class="md-nav__item">
2117 <a href="#executing-an-action" class="md-nav__link">
2118 Executing an Action
2119 </a>
2120
2121</li>
2122
2123 <li class="md-nav__item">
2124 <a href="#custom-method-with-ajax-support" class="md-nav__link">
2125 Custom Method with AJAX Support
2126 </a>
2127
2128 <nav class="md-nav" aria-label="Custom Method with AJAX Support">
2129 <ul class="md-nav__list">
2130
2131 <li class="md-nav__item">
2132 <a href="#ajax-validation" class="md-nav__link">
2133 AJAX Validation
2134 </a>
2135
2136</li>
2137
2138 <li class="md-nav__item">
2139 <a href="#create-update-and-delete" class="md-nav__link">
2140 create, update and delete
2141 </a>
2142
2143</li>
2144
2145 <li class="md-nav__item">
2146 <a href="#allow-invokation-by-guests" class="md-nav__link">
2147 Allow Invokation by Guests
2148 </a>
2149
2150</li>
2151
2152 <li class="md-nav__item">
2153 <a href="#acp-access-only" class="md-nav__link">
2154 ACP Access Only
2155 </a>
2156
2157</li>
2158
2159 </ul>
2160 </nav>
2161
2162</li>
2163
2164 </ul>
2165 </nav>
2166
2167</li>
2168
2169 </ul>
2170
2171</nav>
2172 </div>
2173 </div>
2174 </div>
2175
2176
2177 <div class="md-content" data-md-component="content">
2178 <article class="md-content__inner md-typeset">
2179
2180
9b8bddda 2181 <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
2182 <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>
2183 </a>
2184
45ca63d0
TD
2185
2186 <h1 id="database-objects">Database Objects<a class="headerlink" href="#database-objects" title="Permanent link">#</a></h1>
2187<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>
2188<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>
2189<h2 id="databaseobject">DatabaseObject<a class="headerlink" href="#databaseobject" title="Permanent link">#</a></h2>
2190<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>
2191<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2192<span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span>
2193<span class="k">use</span> <span class="nx">wcf\data\DatabaseObject</span><span class="p">;</span>
2194
2195<span class="k">class</span> <span class="nc">Example</span> <span class="k">extends</span> <span class="nx">DatabaseObject</span> <span class="p">{}</span>
2196</code></pre></div>
45ca63d0
TD
2197<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>
2198<p>You can prevent this automatic guessing by setting the class properties <code>$databaseTableName</code> and <code>$databaseTableIndexName</code> manually.</p>
2199<h2 id="databaseobjectdecorator">DatabaseObjectDecorator<a class="headerlink" href="#databaseobjectdecorator" title="Permanent link">#</a></h2>
2200<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>
2201<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2202<span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span>
2203<span class="k">use</span> <span class="nx">wcf\data\DatabaseObjectDecorator</span><span class="p">;</span>
2204
2205<span class="k">class</span> <span class="nc">ViewableExample</span> <span class="k">extends</span> <span class="nx">DatabaseObjectDecorator</span> <span class="p">{</span>
2206 <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>
2207
2208 <span class="k">public</span> <span class="k">function</span> <span class="nf">getOutput</span><span class="p">()</span> <span class="p">{</span>
2209 <span class="nv">$output</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
2210
2211 <span class="c1">// [determine output]</span>
2212
2213 <span class="k">return</span> <span class="nv">$output</span><span class="p">;</span>
2214 <span class="p">}</span>
2215<span class="p">}</span>
2216</code></pre></div>
45ca63d0
TD
2217<p>It is mandatory to set the static <code>$baseClass</code> property to the name of the decorated class.</p>
2218<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.
2219You can access the decorated objects directly via <code>DatabaseObjectDecorator::getDecoratedObject()</code>.</p>
2220<h2 id="databaseobjecteditor">DatabaseObjectEditor<a class="headerlink" href="#databaseobjecteditor" title="Permanent link">#</a></h2>
2221<div class="admonition info">
2222<p class="admonition-title">This is the low-level interface to manipulate data rows, it is recommended to use <code>AbstractDatabaseObjectAction</code>.</p>
2223</div>
2224<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>
2225<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2226<span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span>
2227<span class="k">use</span> <span class="nx">wcf\data\DatabaseObjectEditor</span><span class="p">;</span>
2228
2229<span class="k">class</span> <span class="nc">ExampleEditor</span> <span class="k">extends</span> <span class="nx">DatabaseObjectEditor</span> <span class="p">{</span>
2230 <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>
2231<span class="p">}</span>
2232</code></pre></div>
45ca63d0
TD
2233<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>
2234<h3 id="create-a-new-row">Create a new row<a class="headerlink" href="#create-a-new-row" title="Permanent link">#</a></h3>
2235<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>
2236<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2237<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>
2238 <span class="s1">&#39;bar&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Hello World!&#39;</span>
2239<span class="p">]);</span>
2240
2241<span class="c1">// output: Hello World!</span>
2242<span class="k">echo</span> <span class="nv">$example</span><span class="o">-&gt;</span><span class="na">bar</span><span class="p">;</span>
2243</code></pre></div>
45ca63d0
TD
2244<h3 id="updating-an-existing-row">Updating an existing row<a class="headerlink" href="#updating-an-existing-row" title="Permanent link">#</a></h3>
2245<div class="admonition warning">
2246<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>
2247</div>
2248<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2249<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>
2250<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>
2251<span class="nv">$exampleEditor</span><span class="o">-&gt;</span><span class="na">update</span><span class="p">([</span>
2252 <span class="s1">&#39;bar&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;baz&#39;</span>
2253<span class="p">]);</span>
2254
2255<span class="c1">// output: Hello World!</span>
2256<span class="k">echo</span> <span class="nv">$example</span><span class="o">-&gt;</span><span class="na">bar</span><span class="p">;</span>
2257
2258<span class="c1">// re-creating the object will query the database again and retrieve the updated value</span>
2259<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">-&gt;</span><span class="na">id</span><span class="p">);</span>
2260
2261<span class="c1">// output: baz</span>
2262<span class="k">echo</span> <span class="nv">$example</span><span class="o">-&gt;</span><span class="na">bar</span><span class="p">;</span>
2263</code></pre></div>
45ca63d0
TD
2264<h3 id="deleting-a-row">Deleting a row<a class="headerlink" href="#deleting-a-row" title="Permanent link">#</a></h3>
2265<div class="admonition warning">
2266<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>
2267</div>
2268<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2269<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>
2270<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>
2271<span class="nv">$exampleEditor</span><span class="o">-&gt;</span><span class="na">delete</span><span class="p">();</span>
2272</code></pre></div>
45ca63d0
TD
2273<h2 id="databaseobjectlist">DatabaseObjectList<a class="headerlink" href="#databaseobjectlist" title="Permanent link">#</a></h2>
2274<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>
2275<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2276<span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span>
2277<span class="k">use</span> <span class="nx">wcf\data\DatabaseObjectList</span><span class="p">;</span>
2278
2279<span class="k">class</span> <span class="nc">ExampleList</span> <span class="k">extends</span> <span class="nx">DatabaseObjectList</span> <span class="p">{</span>
2280 <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>
2281<span class="p">}</span>
2282</code></pre></div>
45ca63d0
TD
2283<p>The following code listing illustrates loading a large set of examples and iterating over the list to retrieve the objects.</p>
2284<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2285<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>
2286<span class="c1">// add constraints using the condition builder</span>
2287<span class="nv">$exampleList</span><span class="o">-&gt;</span><span class="na">getConditionBuilder</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">add</span><span class="p">(</span><span class="s1">&#39;bar IN (?)&#39;</span><span class="p">,</span> <span class="p">[[</span><span class="s1">&#39;Hello World!&#39;</span><span class="p">,</span> <span class="s1">&#39;bar&#39;</span><span class="p">,</span> <span class="s1">&#39;baz&#39;</span><span class="p">]]);</span>
2288<span class="c1">// actually read the rows</span>
2289<span class="nv">$exampleList</span><span class="o">-&gt;</span><span class="na">readObjects</span><span class="p">();</span>
2290<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>
2291 <span class="k">echo</span> <span class="nv">$example</span><span class="o">-&gt;</span><span class="na">bar</span><span class="p">;</span>
2292<span class="p">}</span>
2293
2294<span class="c1">// retrieve the models directly instead of iterating over them</span>
2295<span class="nv">$examples</span> <span class="o">=</span> <span class="nv">$exampleList</span><span class="o">-&gt;</span><span class="na">getObjects</span><span class="p">();</span>
2296
2297<span class="c1">// just retrieve the number of rows</span>
2298<span class="nv">$exampleCount</span> <span class="o">=</span> <span class="nv">$exampleList</span><span class="o">-&gt;</span><span class="na">countObjects</span><span class="p">();</span>
2299</code></pre></div>
45ca63d0
TD
2300<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>
2301<p>Additionally, <code>DatabaseObjectList</code> objects has the following three public properties that are useful when fetching data with lists:</p>
2302<ul>
2303<li><code>$sqlLimit</code> determines how many rows are fetched.
2304 If its value is <code>0</code> (which is the default value), all results are fetched.
2305 So be careful when dealing with large tables and you only want a limited number of rows:
2306 Set <code>$sqlLimit</code> to a value larger than zero!</li>
2307<li><code>$sqlOffset</code>:
2308 Paginated pages like a thread list use this feature a lot, it allows you to skip a given number of results.
2309 Imagine you want to display 20 threads per page but there are a total of 60 threads available.
2310 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>
2311<li><code>$sqlOrderBy</code> determines by which column(s) the rows are sorted in which order.
2312 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>
2313</ul>
2314<p>For more advanced usage, there two additional fields that deal with the type of objects returned.
2315First, let's go into a bit more detail what setting the <code>$className</code> property actually does:</p>
2316<ol>
2317<li>It is the type of database object in which the rows are wrapped.</li>
2318<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>
2319</ol>
2320<p>Sometimes you might use the database table of some database object but wrap the rows in another database object.
2321This can be achieved by setting the <code>$objectClassName</code> property to the desired class name.</p>
2322<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>
2323<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2324<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>
2325<span class="nv">$exampleList</span><span class="o">-&gt;</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>
2326</code></pre></div>
45ca63d0
TD
2327<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>
2328<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2329<span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span>
2330
2331<span class="k">class</span> <span class="nc">ViewableExampleList</span> <span class="k">extends</span> <span class="nx">ExampleList</span> <span class="p">{</span>
2332 <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>
2333<span class="p">}</span>
2334</code></pre></div>
45ca63d0
TD
2335<h2 id="abstractdatabaseobjectaction">AbstractDatabaseObjectAction<a class="headerlink" href="#abstractdatabaseobjectaction" title="Permanent link">#</a></h2>
2336<p>Row creation and manipulation can be performed using the aforementioned <code>DatabaseObjectEditor</code> class, but this approach has two major issues:</p>
2337<ol>
2338<li>Row creation, update and deletion takes place silently without notifying any other components.</li>
2339<li>Data is passed to the database adapter without any further processing.</li>
2340</ol>
2341<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>
2342<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2343<span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span>
2344<span class="k">use</span> <span class="nx">wcf\data\AbstractDatabaseObjectAction</span><span class="p">;</span>
2345
2346<span class="k">class</span> <span class="nc">ExampleAction</span> <span class="k">extends</span> <span class="nx">AbstractDatabaseObjectAction</span> <span class="p">{</span>
2347 <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>
2348<span class="p">}</span>
2349</code></pre></div>
45ca63d0
TD
2350<h3 id="executing-an-action">Executing an Action<a class="headerlink" href="#executing-an-action" title="Permanent link">#</a></h3>
2351<div class="admonition warning">
2352<p class="admonition-title">The method <code>AbstractDatabaseObjectAction::validateAction()</code> is internally used for AJAX method invocation and must not be called programmatically.</p>
2353</div>
2354<p>The next example represents the same functionality as seen for <code>DatabaseObjectEditor</code>:</p>
2355<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2356<span class="k">use</span> <span class="nx">wcf\data\example\ExampleAction</span><span class="p">;</span>
2357
2358<span class="c1">// create a row</span>
2359<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">&#39;create&#39;</span><span class="p">,</span> <span class="p">[</span>
2360 <span class="s1">&#39;data&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;bar&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Hello World&#39;</span><span class="p">]</span>
2361<span class="p">]);</span>
2362<span class="nv">$example</span> <span class="o">=</span> <span class="nv">$exampleAction</span><span class="o">-&gt;</span><span class="na">executeAction</span><span class="p">()[</span><span class="s1">&#39;returnValues&#39;</span><span class="p">];</span>
2363
2364<span class="c1">// update a row using the id</span>
2365<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">&#39;update&#39;</span><span class="p">,</span> <span class="p">[</span>
2366 <span class="s1">&#39;data&#39;</span> <span class="o">=&gt;</span> <span class="p">[</span><span class="s1">&#39;bar&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;baz&#39;</span><span class="p">]</span>
2367<span class="p">]);</span>
2368<span class="nv">$exampleAction</span><span class="o">-&gt;</span><span class="na">executeAction</span><span class="p">();</span>
2369
2370<span class="c1">// delete a row using a model</span>
2371<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">&#39;delete&#39;</span><span class="p">);</span>
2372<span class="nv">$exampleAction</span><span class="o">-&gt;</span><span class="na">executeAction</span><span class="p">();</span>
2373</code></pre></div>
45ca63d0
TD
2374<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>
2375<p><span class="label label-info">Events</span> <code>initializeAction</code>, <code>validateAction</code> and <code>finalizeAction</code></p>
2376<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>
2377<p>This section is about adding the method <code>baz()</code> to <code>ExampleAction</code> and calling it via AJAX.</p>
2378<h4 id="ajax-validation">AJAX Validation<a class="headerlink" href="#ajax-validation" title="Permanent link">#</a></h4>
2379<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>
2380<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>
2381<h4 id="create-update-and-delete">create, update and delete<a class="headerlink" href="#create-update-and-delete" title="Permanent link">#</a></h4>
2382<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>
2383<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2384<span class="k">namespace</span> <span class="nx">wcf\data\example</span><span class="p">;</span>
2385<span class="k">use</span> <span class="nx">wcf\data\AbstractDatabaseObjectAction</span><span class="p">;</span>
2386
2387<span class="k">class</span> <span class="nc">ExampleAction</span> <span class="k">extends</span> <span class="nx">AbstractDatabaseObjectAction</span> <span class="p">{</span>
2388 <span class="c1">// `create()` can now be called via AJAX if the requesting user posses the listed permissions</span>
2389 <span class="k">protected</span> <span class="nv">$permissionsCreate</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;admin.example.canManageExample&#39;</span><span class="p">];</span>
2390
2391 <span class="k">public</span> <span class="k">function</span> <span class="nf">validateUpdate</span><span class="p">()</span> <span class="p">{</span>
2392 <span class="c1">// your very own validation logic that does not make use of the</span>
2393 <span class="c1">// built-in `$permissionsUpdate` property</span>
2394
2395 <span class="c1">// you can still invoke the built-in permissions check if you like to</span>
2396 <span class="k">parent</span><span class="o">::</span><span class="na">validateUpdate</span><span class="p">();</span>
2397 <span class="p">}</span>
2398<span class="p">}</span>
2399</code></pre></div>
45ca63d0
TD
2400<h4 id="allow-invokation-by-guests">Allow Invokation by Guests<a class="headerlink" href="#allow-invokation-by-guests" title="Permanent link">#</a></h4>
2401<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>
2402<h4 id="acp-access-only">ACP Access Only<a class="headerlink" href="#acp-access-only" title="Permanent link">#</a></h4>
2403<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>
2404
4a5c32e1
WG
2405
2406
2407
2408<hr>
2409<div class="md-source-date">
2410 <small>
2411
2412 Last update: 2021-02-11
2413
2414 </small>
2415</div>
2416
2417
45ca63d0
TD
2418
2419
2420
2421
2422
2423
2424 </article>
2425 </div>
2426 </div>
fb962f09 2427
45ca63d0
TD
2428 </main>
2429
2430
2431<footer class="md-footer">
2432
2433 <nav class="md-footer__inner md-grid" aria-label="Footer">
2434
2435 <a href="../pages/" class="md-footer__link md-footer__link--prev" rel="prev">
2436 <div class="md-footer__button md-icon">
2437 <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>
2438 </div>
2439 <div class="md-footer__title">
2440 <div class="md-ellipsis">
2441 <span class="md-footer__direction">
2442 Previous
2443 </span>
2444 Pages
2445 </div>
2446 </div>
2447 </a>
2448
2449
2450 <a href="../database-access/" class="md-footer__link md-footer__link--next" rel="next">
2451 <div class="md-footer__title">
2452 <div class="md-ellipsis">
2453 <span class="md-footer__direction">
2454 Next
2455 </span>
2456 Database Access
2457 </div>
2458 </div>
2459 <div class="md-footer__button md-icon">
2460 <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>
2461 </div>
2462 </a>
2463
2464 </nav>
2465
2466 <div class="md-footer-meta md-typeset">
2467 <div class="md-footer-meta__inner md-grid">
2468 <div class="md-footer-copyright">
2469
2470 <div class="md-footer-copyright__highlight">
2471 Copyright © 2020 WoltLab GmbH
2472 </div>
2473
2474 Made with
2475 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
2476 Material for MkDocs
2477 </a>
fb88dc6e 2478
45ca63d0
TD
2479 </div>
2480 <div class="md-footer-copyright">
2481 <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a>
2482 <a href="https://www.woltlab.com/privacy-policy/">Privacy Policy</a>
2483</div>
2484 </div>
2485 </div>
2486</footer>
2487
2488 </div>
2489 <div class="md-dialog" data-md-component="dialog">
2490 <div class="md-dialog__inner md-typeset"></div>
2491 </div>
fb962f09 2492 <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
2493
2494
a4835aa6 2495 <script src="../../assets/javascripts/bundle.4ea5477f.min.js"></script>
45ca63d0
TD
2496
2497
2498 </body>
2499</html>