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