3 <html lang=
"en" class=
"no-js">
7 <meta name=
"viewport" content=
"width=device-width,initial-scale=1">
12 <link rel=
"canonical" href=
"https://docs.woltlab.com/5.4/php/code-style-documentation/">
14 <link rel=
"icon" href=
"../../assets/default.favicon.ico">
15 <meta name=
"generator" content=
"mkdocs-1.1.2, mkdocs-material-7.1.2">
19 <title>Documentation - WoltLab Suite Documentation
</title>
23 <link rel=
"stylesheet" href=
"../../assets/stylesheets/main.6f955dcd.min.css">
26 <link rel=
"stylesheet" href=
"../../assets/stylesheets/palette.ef6f36e2.min.css">
30 <meta name=
"theme-color" content=
"#009485">
40 <link rel=
"stylesheet" href=
"../../stylesheets/extra.css">
54 <body dir=
"ltr" data-md-color-scheme=
"" data-md-color-primary=
"teal" data-md-color-accent=
"">
57 <script>function __prefix(e){return new URL(
"../..",location).pathname+
"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}
</script>
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">
65 <a href=
"#documentation" class=
"md-skip">
70 <div data-md-component=
"announce">
72 <aside class=
"md-announce">
73 <div class=
"md-announce__inner md-grid md-typeset">
75 <a href=
"https://www.woltlab.com">Back to
<strong>woltlab.com
</strong></a>
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">
86 <img src=
"../../assets/logo.png" alt=
"logo">
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>
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
99 <div class=
"md-header__topic" data-md-component=
"header-topic">
100 <span class=
"md-ellipsis">
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>
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>
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>
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">
134 <ol class=
"md-search-result__list"></ol>
142 <div class=
"md-header__source">
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">
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>
149 <div class=
"md-source__repository">
158 <div class=
"md-container" data-md-component=
"container">
163 <main class=
"md-main" data-md-component=
"main">
164 <div class=
"md-main__inner md-grid">
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">
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">
178 <img src=
"../../assets/logo.png" alt=
"logo">
181 WoltLab Suite Documentation
184 <div class=
"md-nav__source">
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">
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>
191 <div class=
"md-source__repository">
197 <ul class=
"md-nav__list" data-md-scrollfix
>
206 <li class=
"md-nav__item">
207 <a href=
"../../getting-started/" class=
"md-nav__link">
222 <li class=
"md-nav__item md-nav__item--nested">
225 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2" type=
"checkbox" id=
"__nav_2" >
227 <label class=
"md-nav__link" for=
"__nav_2">
229 <span class=
"md-nav__icon md-icon"></span>
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>
236 <ul class=
"md-nav__list" data-md-scrollfix
>
242 <li class=
"md-nav__item">
243 <a href=
"../pages/" class=
"md-nav__link">
254 <li class=
"md-nav__item">
255 <a href=
"../database-objects/" class=
"md-nav__link">
266 <li class=
"md-nav__item">
267 <a href=
"../database-access/" class=
"md-nav__link">
278 <li class=
"md-nav__item">
279 <a href=
"../exceptions/" class=
"md-nav__link">
291 <li class=
"md-nav__item md-nav__item--nested">
294 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5" type=
"checkbox" id=
"__nav_2_5" >
296 <label class=
"md-nav__link" for=
"__nav_2_5">
298 <span class=
"md-nav__icon md-icon"></span>
300 <nav class=
"md-nav" aria-label=
"API" data-md-level=
"2">
301 <label class=
"md-nav__title" for=
"__nav_2_5">
302 <span class=
"md-nav__icon md-icon"></span>
305 <ul class=
"md-nav__list" data-md-scrollfix
>
312 <li class=
"md-nav__item md-nav__item--nested">
315 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_1" type=
"checkbox" id=
"__nav_2_5_1" >
317 <label class=
"md-nav__link" for=
"__nav_2_5_1">
319 <span class=
"md-nav__icon md-icon"></span>
321 <nav class=
"md-nav" aria-label=
"Caches" data-md-level=
"3">
322 <label class=
"md-nav__title" for=
"__nav_2_5_1">
323 <span class=
"md-nav__icon md-icon"></span>
326 <ul class=
"md-nav__list" data-md-scrollfix
>
332 <li class=
"md-nav__item">
333 <a href=
"../api/caches/" class=
"md-nav__link">
344 <li class=
"md-nav__item">
345 <a href=
"../api/caches_persistent-caches/" class=
"md-nav__link">
356 <li class=
"md-nav__item">
357 <a href=
"../api/caches_runtime-caches/" class=
"md-nav__link">
374 <li class=
"md-nav__item">
375 <a href=
"../api/comments/" class=
"md-nav__link">
386 <li class=
"md-nav__item">
387 <a href=
"../api/cronjobs/" class=
"md-nav__link">
398 <li class=
"md-nav__item">
399 <a href=
"../api/events/" class=
"md-nav__link">
411 <li class=
"md-nav__item md-nav__item--nested">
414 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_5" type=
"checkbox" id=
"__nav_2_5_5" >
416 <label class=
"md-nav__link" for=
"__nav_2_5_5">
418 <span class=
"md-nav__icon md-icon"></span>
420 <nav class=
"md-nav" aria-label=
"Form Builder" data-md-level=
"3">
421 <label class=
"md-nav__title" for=
"__nav_2_5_5">
422 <span class=
"md-nav__icon md-icon"></span>
425 <ul class=
"md-nav__list" data-md-scrollfix
>
431 <li class=
"md-nav__item">
432 <a href=
"../api/form_builder/overview/" class=
"md-nav__link">
443 <li class=
"md-nav__item">
444 <a href=
"../api/form_builder/structure/" class=
"md-nav__link">
455 <li class=
"md-nav__item">
456 <a href=
"../api/form_builder/form_fields/" class=
"md-nav__link">
467 <li class=
"md-nav__item">
468 <a href=
"../api/form_builder/validation_data/" class=
"md-nav__link">
479 <li class=
"md-nav__item">
480 <a href=
"../api/form_builder/dependencies/" class=
"md-nav__link">
497 <li class=
"md-nav__item">
498 <a href=
"../api/package_installation_plugins/" class=
"md-nav__link">
499 Package Installation Plugins
509 <li class=
"md-nav__item">
510 <a href=
"../api/user_activity_points/" class=
"md-nav__link">
521 <li class=
"md-nav__item">
522 <a href=
"../api/user_notifications/" class=
"md-nav__link">
533 <li class=
"md-nav__item">
534 <a href=
"../api/sitemaps/" class=
"md-nav__link">
551 <li class=
"md-nav__item">
552 <a href=
"../code-style/" class=
"md-nav__link">
563 <li class=
"md-nav__item">
564 <a href=
"../apps/" class=
"md-nav__link">
575 <li class=
"md-nav__item">
576 <a href=
"../gdpr/" class=
"md-nav__link">
597 <li class=
"md-nav__item md-nav__item--nested">
600 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_3" type=
"checkbox" id=
"__nav_3" >
602 <label class=
"md-nav__link" for=
"__nav_3">
603 Languages, Templates & CSS
604 <span class=
"md-nav__icon md-icon"></span>
606 <nav class=
"md-nav" aria-label=
"Languages, Templates & CSS" data-md-level=
"1">
607 <label class=
"md-nav__title" for=
"__nav_3">
608 <span class=
"md-nav__icon md-icon"></span>
609 Languages, Templates & CSS
611 <ul class=
"md-nav__list" data-md-scrollfix
>
617 <li class=
"md-nav__item">
618 <a href=
"../../view/languages/" class=
"md-nav__link">
629 <li class=
"md-nav__item">
630 <a href=
"../../view/templates/" class=
"md-nav__link">
641 <li class=
"md-nav__item">
642 <a href=
"../../view/template-plugins/" class=
"md-nav__link">
653 <li class=
"md-nav__item">
654 <a href=
"../../view/css/" class=
"md-nav__link">
675 <li class=
"md-nav__item md-nav__item--nested">
678 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4" type=
"checkbox" id=
"__nav_4" >
680 <label class=
"md-nav__link" for=
"__nav_4">
681 TypeScript and JavaScript API
682 <span class=
"md-nav__icon md-icon"></span>
684 <nav class=
"md-nav" aria-label=
"TypeScript and JavaScript API" data-md-level=
"1">
685 <label class=
"md-nav__title" for=
"__nav_4">
686 <span class=
"md-nav__icon md-icon"></span>
687 TypeScript and JavaScript API
689 <ul class=
"md-nav__list" data-md-scrollfix
>
695 <li class=
"md-nav__item">
696 <a href=
"../../javascript/general-usage/" class=
"md-nav__link">
707 <li class=
"md-nav__item">
708 <a href=
"../../javascript/typescript/" class=
"md-nav__link">
720 <li class=
"md-nav__item md-nav__item--nested">
723 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4_3" type=
"checkbox" id=
"__nav_4_3" >
725 <label class=
"md-nav__link" for=
"__nav_4_3">
727 <span class=
"md-nav__icon md-icon"></span>
729 <nav class=
"md-nav" aria-label=
"New API" data-md-level=
"2">
730 <label class=
"md-nav__title" for=
"__nav_4_3">
731 <span class=
"md-nav__icon md-icon"></span>
734 <ul class=
"md-nav__list" data-md-scrollfix
>
740 <li class=
"md-nav__item">
741 <a href=
"../../javascript/new-api_writing-a-module/" class=
"md-nav__link">
752 <li class=
"md-nav__item">
753 <a href=
"../../javascript/new-api_data-structures/" class=
"md-nav__link">
764 <li class=
"md-nav__item">
765 <a href=
"../../javascript/new-api_core/" class=
"md-nav__link">
776 <li class=
"md-nav__item">
777 <a href=
"../../javascript/new-api_dom/" class=
"md-nav__link">
788 <li class=
"md-nav__item">
789 <a href=
"../../javascript/new-api_events/" class=
"md-nav__link">
800 <li class=
"md-nav__item">
801 <a href=
"../../javascript/new-api_ajax/" class=
"md-nav__link">
812 <li class=
"md-nav__item">
813 <a href=
"../../javascript/new-api_dialogs/" class=
"md-nav__link">
824 <li class=
"md-nav__item">
825 <a href=
"../../javascript/new-api_browser/" class=
"md-nav__link">
826 Browser and Screen Sizes
836 <li class=
"md-nav__item">
837 <a href=
"../../javascript/new-api_ui/" class=
"md-nav__link">
854 <li class=
"md-nav__item">
855 <a href=
"../../javascript/legacy-api/" class=
"md-nav__link">
866 <li class=
"md-nav__item">
867 <a href=
"../../javascript/helper-functions/" class=
"md-nav__link">
878 <li class=
"md-nav__item">
879 <a href=
"../../javascript/code-snippets/" class=
"md-nav__link">
900 <li class=
"md-nav__item md-nav__item--nested">
903 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5" type=
"checkbox" id=
"__nav_5" >
905 <label class=
"md-nav__link" for=
"__nav_5">
907 <span class=
"md-nav__icon md-icon"></span>
909 <nav class=
"md-nav" aria-label=
"Package Components" data-md-level=
"1">
910 <label class=
"md-nav__title" for=
"__nav_5">
911 <span class=
"md-nav__icon md-icon"></span>
914 <ul class=
"md-nav__list" data-md-scrollfix
>
920 <li class=
"md-nav__item">
921 <a href=
"../../package/package-xml/" class=
"md-nav__link">
933 <li class=
"md-nav__item md-nav__item--nested">
936 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5_2" type=
"checkbox" id=
"__nav_5_2" >
938 <label class=
"md-nav__link" for=
"__nav_5_2">
940 <span class=
"md-nav__icon md-icon"></span>
942 <nav class=
"md-nav" aria-label=
"PIPs" data-md-level=
"2">
943 <label class=
"md-nav__title" for=
"__nav_5_2">
944 <span class=
"md-nav__icon md-icon"></span>
947 <ul class=
"md-nav__list" data-md-scrollfix
>
953 <li class=
"md-nav__item">
954 <a href=
"../../package/pip/" class=
"md-nav__link">
965 <li class=
"md-nav__item">
966 <a href=
"../../package/pip/acl-option/" class=
"md-nav__link">
977 <li class=
"md-nav__item">
978 <a href=
"../../package/pip/acp-menu/" class=
"md-nav__link">
989 <li class=
"md-nav__item">
990 <a href=
"../../package/pip/acp-search-provider/" class=
"md-nav__link">
1001 <li class=
"md-nav__item">
1002 <a href=
"../../package/pip/acp-template/" class=
"md-nav__link">
1013 <li class=
"md-nav__item">
1014 <a href=
"../../package/pip/bbcode/" class=
"md-nav__link">
1025 <li class=
"md-nav__item">
1026 <a href=
"../../package/pip/box/" class=
"md-nav__link">
1037 <li class=
"md-nav__item">
1038 <a href=
"../../package/pip/clipboard-action/" class=
"md-nav__link">
1049 <li class=
"md-nav__item">
1050 <a href=
"../../package/pip/core-object/" class=
"md-nav__link">
1061 <li class=
"md-nav__item">
1062 <a href=
"../../package/pip/cronjob/" class=
"md-nav__link">
1073 <li class=
"md-nav__item">
1074 <a href=
"../../package/pip/database/" class=
"md-nav__link">
1085 <li class=
"md-nav__item">
1086 <a href=
"../../package/pip/event-listener/" class=
"md-nav__link">
1097 <li class=
"md-nav__item">
1098 <a href=
"../../package/pip/file/" class=
"md-nav__link">
1109 <li class=
"md-nav__item">
1110 <a href=
"../../package/pip/language/" class=
"md-nav__link">
1121 <li class=
"md-nav__item">
1122 <a href=
"../../package/pip/media-provider/" class=
"md-nav__link">
1133 <li class=
"md-nav__item">
1134 <a href=
"../../package/pip/menu/" class=
"md-nav__link">
1145 <li class=
"md-nav__item">
1146 <a href=
"../../package/pip/menu-item/" class=
"md-nav__link">
1157 <li class=
"md-nav__item">
1158 <a href=
"../../package/pip/object-type/" class=
"md-nav__link">
1169 <li class=
"md-nav__item">
1170 <a href=
"../../package/pip/object-type-definition/" class=
"md-nav__link">
1171 objectTypeDefinition
1181 <li class=
"md-nav__item">
1182 <a href=
"../../package/pip/option/" class=
"md-nav__link">
1193 <li class=
"md-nav__item">
1194 <a href=
"../../package/pip/page/" class=
"md-nav__link">
1205 <li class=
"md-nav__item">
1206 <a href=
"../../package/pip/pip/" class=
"md-nav__link">
1217 <li class=
"md-nav__item">
1218 <a href=
"../../package/pip/script/" class=
"md-nav__link">
1229 <li class=
"md-nav__item">
1230 <a href=
"../../package/pip/smiley/" class=
"md-nav__link">
1241 <li class=
"md-nav__item">
1242 <a href=
"../../package/pip/sql/" class=
"md-nav__link">
1253 <li class=
"md-nav__item">
1254 <a href=
"../../package/pip/style/" class=
"md-nav__link">
1265 <li class=
"md-nav__item">
1266 <a href=
"../../package/pip/template/" class=
"md-nav__link">
1277 <li class=
"md-nav__item">
1278 <a href=
"../../package/pip/template-listener/" class=
"md-nav__link">
1289 <li class=
"md-nav__item">
1290 <a href=
"../../package/pip/user-group-option/" class=
"md-nav__link">
1301 <li class=
"md-nav__item">
1302 <a href=
"../../package/pip/user-menu/" class=
"md-nav__link">
1313 <li class=
"md-nav__item">
1314 <a href=
"../../package/pip/user-notification-event/" class=
"md-nav__link">
1315 userNotificationEvent
1325 <li class=
"md-nav__item">
1326 <a href=
"../../package/pip/user-option/" class=
"md-nav__link">
1337 <li class=
"md-nav__item">
1338 <a href=
"../../package/pip/user-profile-menu/" class=
"md-nav__link">
1355 <li class=
"md-nav__item">
1356 <a href=
"../../package/database-php-api/" class=
"md-nav__link">
1377 <li class=
"md-nav__item md-nav__item--nested">
1380 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6" type=
"checkbox" id=
"__nav_6" >
1382 <label class=
"md-nav__link" for=
"__nav_6">
1384 <span class=
"md-nav__icon md-icon"></span>
1386 <nav class=
"md-nav" aria-label=
"Migration" data-md-level=
"1">
1387 <label class=
"md-nav__title" for=
"__nav_6">
1388 <span class=
"md-nav__icon md-icon"></span>
1391 <ul class=
"md-nav__list" data-md-scrollfix
>
1398 <li class=
"md-nav__item md-nav__item--nested">
1401 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_1" type=
"checkbox" id=
"__nav_6_1" >
1403 <label class=
"md-nav__link" for=
"__nav_6_1">
1404 Migrating from WSC
5.3
1405 <span class=
"md-nav__icon md-icon"></span>
1407 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.3" data-md-level=
"2">
1408 <label class=
"md-nav__title" for=
"__nav_6_1">
1409 <span class=
"md-nav__icon md-icon"></span>
1410 Migrating from WSC
5.3
1412 <ul class=
"md-nav__list" data-md-scrollfix
>
1418 <li class=
"md-nav__item">
1419 <a href=
"../../migration/wsc53/php/" class=
"md-nav__link">
1430 <li class=
"md-nav__item">
1431 <a href=
"../../migration/wsc53/session/" class=
"md-nav__link">
1432 Session Handling and Authentication
1442 <li class=
"md-nav__item">
1443 <a href=
"../../migration/wsc53/javascript/" class=
"md-nav__link">
1444 TypeScript and JavaScript
1454 <li class=
"md-nav__item">
1455 <a href=
"../../migration/wsc53/templates/" class=
"md-nav__link">
1466 <li class=
"md-nav__item">
1467 <a href=
"../../migration/wsc53/libraries/" class=
"md-nav__link">
1468 Third Party Libraries
1485 <li class=
"md-nav__item md-nav__item--nested">
1488 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_2" type=
"checkbox" id=
"__nav_6_2" >
1490 <label class=
"md-nav__link" for=
"__nav_6_2">
1491 Migrating from WSC
5.2
1492 <span class=
"md-nav__icon md-icon"></span>
1494 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.2" data-md-level=
"2">
1495 <label class=
"md-nav__title" for=
"__nav_6_2">
1496 <span class=
"md-nav__icon md-icon"></span>
1497 Migrating from WSC
5.2
1499 <ul class=
"md-nav__list" data-md-scrollfix
>
1505 <li class=
"md-nav__item">
1506 <a href=
"../../migration/wsc52/php/" class=
"md-nav__link">
1517 <li class=
"md-nav__item">
1518 <a href=
"../../migration/wsc52/templates/" class=
"md-nav__link">
1519 Templates and Languages
1529 <li class=
"md-nav__item">
1530 <a href=
"../../migration/wsc52/libraries/" class=
"md-nav__link">
1531 Third Party Libraries
1548 <li class=
"md-nav__item md-nav__item--nested">
1551 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_3" type=
"checkbox" id=
"__nav_6_3" >
1553 <label class=
"md-nav__link" for=
"__nav_6_3">
1554 Migrating from WSC
3.1
1555 <span class=
"md-nav__icon md-icon"></span>
1557 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.1" data-md-level=
"2">
1558 <label class=
"md-nav__title" for=
"__nav_6_3">
1559 <span class=
"md-nav__icon md-icon"></span>
1560 Migrating from WSC
3.1
1562 <ul class=
"md-nav__list" data-md-scrollfix
>
1568 <li class=
"md-nav__item">
1569 <a href=
"../../migration/wsc31/php/" class=
"md-nav__link">
1587 <li class=
"md-nav__item md-nav__item--nested">
1590 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_4" type=
"checkbox" id=
"__nav_6_4" >
1592 <label class=
"md-nav__link" for=
"__nav_6_4">
1593 Migrating from WSC
3.0
1594 <span class=
"md-nav__icon md-icon"></span>
1596 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.0" data-md-level=
"2">
1597 <label class=
"md-nav__title" for=
"__nav_6_4">
1598 <span class=
"md-nav__icon md-icon"></span>
1599 Migrating from WSC
3.0
1601 <ul class=
"md-nav__list" data-md-scrollfix
>
1607 <li class=
"md-nav__item">
1608 <a href=
"../../migration/wsc30/php/" class=
"md-nav__link">
1619 <li class=
"md-nav__item">
1620 <a href=
"../../migration/wsc30/javascript/" class=
"md-nav__link">
1631 <li class=
"md-nav__item">
1632 <a href=
"../../migration/wsc30/templates/" class=
"md-nav__link">
1643 <li class=
"md-nav__item">
1644 <a href=
"../../migration/wsc30/css/" class=
"md-nav__link">
1655 <li class=
"md-nav__item">
1656 <a href=
"../../migration/wsc30/package/" class=
"md-nav__link">
1674 <li class=
"md-nav__item md-nav__item--nested">
1677 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_5" type=
"checkbox" id=
"__nav_6_5" >
1679 <label class=
"md-nav__link" for=
"__nav_6_5">
1680 Migrating from WCF
2.1
1681 <span class=
"md-nav__icon md-icon"></span>
1683 <nav class=
"md-nav" aria-label=
"Migrating from WCF 2.1" data-md-level=
"2">
1684 <label class=
"md-nav__title" for=
"__nav_6_5">
1685 <span class=
"md-nav__icon md-icon"></span>
1686 Migrating from WCF
2.1
1688 <ul class=
"md-nav__list" data-md-scrollfix
>
1694 <li class=
"md-nav__item">
1695 <a href=
"../../migration/wcf21/php/" class=
"md-nav__link">
1706 <li class=
"md-nav__item">
1707 <a href=
"../../migration/wcf21/templates/" class=
"md-nav__link">
1718 <li class=
"md-nav__item">
1719 <a href=
"../../migration/wcf21/css/" class=
"md-nav__link">
1730 <li class=
"md-nav__item">
1731 <a href=
"../../migration/wcf21/package/" class=
"md-nav__link">
1758 <li class=
"md-nav__item md-nav__item--nested">
1761 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7" type=
"checkbox" id=
"__nav_7" >
1763 <label class=
"md-nav__link" for=
"__nav_7">
1765 <span class=
"md-nav__icon md-icon"></span>
1767 <nav class=
"md-nav" aria-label=
"Tutorials" data-md-level=
"1">
1768 <label class=
"md-nav__title" for=
"__nav_7">
1769 <span class=
"md-nav__icon md-icon"></span>
1772 <ul class=
"md-nav__list" data-md-scrollfix
>
1779 <li class=
"md-nav__item md-nav__item--nested">
1782 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7_1" type=
"checkbox" id=
"__nav_7_1" >
1784 <label class=
"md-nav__link" for=
"__nav_7_1">
1786 <span class=
"md-nav__icon md-icon"></span>
1788 <nav class=
"md-nav" aria-label=
"Tutorial Series" data-md-level=
"2">
1789 <label class=
"md-nav__title" for=
"__nav_7_1">
1790 <span class=
"md-nav__icon md-icon"></span>
1793 <ul class=
"md-nav__list" data-md-scrollfix
>
1799 <li class=
"md-nav__item">
1800 <a href=
"../../tutorial/series/overview/" class=
"md-nav__link">
1811 <li class=
"md-nav__item">
1812 <a href=
"../../tutorial/series/part_1/" class=
"md-nav__link">
1823 <li class=
"md-nav__item">
1824 <a href=
"../../tutorial/series/part_2/" class=
"md-nav__link">
1835 <li class=
"md-nav__item">
1836 <a href=
"../../tutorial/series/part_3/" class=
"md-nav__link">
1847 <li class=
"md-nav__item">
1848 <a href=
"../../tutorial/series/part_4/" class=
"md-nav__link">
1859 <li class=
"md-nav__item">
1860 <a href=
"../../tutorial/series/part_5/" class=
"md-nav__link">
1887 <div class=
"md-sidebar md-sidebar--secondary" data-md-component=
"sidebar" data-md-type=
"toc" >
1888 <div class=
"md-sidebar__scrollwrap">
1889 <div class=
"md-sidebar__inner">
1891 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
1898 <label class=
"md-nav__title" for=
"__toc">
1899 <span class=
"md-nav__icon md-icon"></span>
1902 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
1904 <li class=
"md-nav__item">
1905 <a href=
"#database-objects" class=
"md-nav__link">
1909 <nav class=
"md-nav" aria-label=
"Database Objects">
1910 <ul class=
"md-nav__list">
1912 <li class=
"md-nav__item">
1913 <a href=
"#database-table-columns-as-properties" class=
"md-nav__link">
1914 Database Table Columns as Properties
1924 <li class=
"md-nav__item">
1925 <a href=
"#database-object-editors" class=
"md-nav__link">
1926 Database Object Editors
1929 <nav class=
"md-nav" aria-label=
"Database Object Editors">
1930 <ul class=
"md-nav__list">
1932 <li class=
"md-nav__item">
1933 <a href=
"#class-tags" class=
"md-nav__link">
1944 <li class=
"md-nav__item">
1945 <a href=
"#runtime-caches" class=
"md-nav__link">
1949 <nav class=
"md-nav" aria-label=
"Runtime Caches">
1950 <ul class=
"md-nav__list">
1952 <li class=
"md-nav__item">
1953 <a href=
"#class-tags_1" class=
"md-nav__link">
1972 <div class=
"md-content" data-md-component=
"content">
1973 <article class=
"md-content__inner md-typeset">
1976 <a href=
"https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/php/code-style-documentation.md" title=
"Edit this page" class=
"md-content__button md-icon">
1977 <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>
1981 <h1 id=
"documentation">Documentation
<a class=
"headerlink" href=
"#documentation" title=
"Permanent link">#
</a></h1>
1982 <div class=
"admonition info">
1983 <p class=
"admonition-title">The following documentation conventions are used by us for our own packages. While you do not have to follow every rule, you are encouraged to do so.
</p>
1985 <h2 id=
"database-objects">Database Objects
<a class=
"headerlink" href=
"#database-objects" title=
"Permanent link">#
</a></h2>
1986 <h3 id=
"database-table-columns-as-properties">Database Table Columns as Properties
<a class=
"headerlink" href=
"#database-table-columns-as-properties" title=
"Permanent link">#
</a></h3>
1987 <p>As the database table columns are not explicit properties of the classes extending
<code>wcf\data\DatabaseObject
</code> but rather stored in
<code>DatabaseObject::$data
</code> and accessible via
<code>DatabaseObject::__get($name)
</code>, the IDE we use, PhpStorm, is neither able to autocomplete such property access nor to interfere the type of the property.
</p>
1988 <p>To solve this problem,
<code>@property-read
</code> tags must be added to the class documentation which registers the database table columns as public read-only properties:
</p>
1989 <table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal">1</span></pre></div></td><td class=
"code"><div class=
"highlight"><pre><span></span><code> * @property-read propertyType $propertyName property description
1992 <p>The properties have to be in the same order as the order in the database table.
</p>
1993 <p>The following table provides templates for common description texts so that similar database table columns have similar description texts.
</p>
1998 <th>description template and example
</th>
2003 <td>unique object id
</td>
2004 <td><code>unique id of the {object name}
</code><br><strong>example:
</strong> <code>unique id of the acl option
</code></td>
2007 <td>id of the delivering package
</td>
2008 <td><code>id of the package which delivers the {object name}
</code><br><strong>example:
</strong> <code>id of the package which delivers the acl option
</code></td>
2011 <td>show order for nested structure
</td>
2012 <td><code>position of the {object name} in relation to its siblings
</code><br><strong>example:
</strong> <code>position of the ACP menu item in relation to its siblings
</code></td>
2015 <td>show order within different object
</td>
2016 <td><code>position of the {object name} in relation to the other {object name}s in the {parent object name}
</code><br><strong>example:
</strong> <code>position of the label in relation to the other labels in the label group
</code></td>
2019 <td>required permissions
</td>
2020 <td><code>comma separated list of user group permissions of which the active user needs to have at least one to see (access, …) the {object name}
</code><br><strong>example:
</strong><code>comma separated list of user group permissions of which the active user needs to have at least one to see the ACP menu item
</code></td>
2023 <td>required options
</td>
2024 <td><code>comma separated list of options of which at least one needs to be enabled for the {object name} to be shown (accessible, …)
</code><br><strong>example:
</strong><code>comma separated list of options of which at least one needs to be enabled for the ACP menu item to be shown
</code></td>
2027 <td>id of the user who has created the object
</td>
2028 <td><code>id of the user who created (wrote, …) the {object name} (or `null` if the user does not exist anymore (or if the {object name} has been created by a guest))
</code><br><strong>example:
</strong><code>id of the user who wrote the comment or `null` if the user does not exist anymore or if the comment has been written by a guest
</code></td>
2031 <td>name of the user who has created the object
</td>
2032 <td><code>name of the user (or guest) who created (wrote, …) the {object name}
</code><br><strong>example:
</strong><code>name of the user or guest who wrote the comment
</code></td>
2035 <td>additional data
</td>
2036 <td><code>array with additional data of the {object name}
</code><br><strong>example:
</strong><code>array with additional data of the user activity event
</code></td>
2039 <td>time-related columns
</td>
2040 <td><code>timestamp at which the {object name} has been created (written, …)
</code><br><strong>example:
</strong><code>timestamp at which the comment has been written
</code></td>
2043 <td>boolean options
</td>
2044 <td><code>is `
1` (or `
0`) if the {object name} … (and thus …), otherwise `
0` (or `
1`)
</code><br><strong>example:
</strong><code>is `
1` if the ad is disabled and thus not shown, otherwise `
0`
</code></td>
2047 <td><code>$cumulativeLikes
</code></td>
2048 <td><code>cumulative result of likes (counting `+
1`) and dislikes (counting `-
1`) for the {object name}
</code><br><strong>example:
</strong><code>cumulative result of likes (counting `+
1`) and dislikes (counting `-
1`) for the article
</code></td>
2051 <td><code>$comments
</code></td>
2052 <td><code>number of comments on the {object name}
</code><br><strong>example:
</strong><code>number of comments on the article
</code></td>
2055 <td><code>$views
</code></td>
2056 <td><code>number of times the {object name} has been viewed
</code><br><strong>example:
</strong><code>number of times the article has been viewed
</code></td>
2059 <td>text field with potential language item name as value
</td>
2060 <td><code>{text type} of the {object name} or name of language item which contains the {text type}
</code><br><strong>example:
</strong><code>description of the cronjob or name of language item which contains the description
</code></td>
2063 <td><code>$objectTypeID
</code></td>
2064 <td><code>id of the `{object type definition name}` object type
</code><br><strong>example:
</strong><code>id of the `com.woltlab.wcf.modifiableContent` object type
</code></td>
2068 <h2 id=
"database-object-editors">Database Object Editors
<a class=
"headerlink" href=
"#database-object-editors" title=
"Permanent link">#
</a></h2>
2069 <h3 id=
"class-tags">Class Tags
<a class=
"headerlink" href=
"#class-tags" title=
"Permanent link">#
</a></h3>
2070 <p>Any database object editor class comment must have to following tags to properly support autocompletion by IDEs:
</p>
2071 <table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal">1</span>
2072 <span class=
"normal">2</span>
2073 <span class=
"normal">3</span>
2074 <span class=
"normal">4</span>
2075 <span class=
"normal">5</span>
2076 <span class=
"normal">6</span></pre></div></td><td class=
"code"><div class=
"highlight"><pre><span></span><code><span class=
"sd">/**
</span>
2077 <span class=
"sd"> * …
</span>
2078 <span class=
"sd"> * @method static {DBO class name} create(array $parameters = [])
</span>
2079 <span class=
"sd"> * @method {DBO class name} getDecoratedObject()
</span>
2080 <span class=
"sd"> * @mixin {DBO class name}
</span>
2081 <span class=
"sd"> */
</span>
2084 <p>The only exception to this rule is if the class overwrites the
<code>create()
</code> method which itself has to be properly documentation then.
</p>
2085 <p>The first and second line makes sure that when calling the
<code>create()
</code> or
<code>getDecoratedObject()
</code> method, the return value is correctly recognized and not just a general
<code>DatabaseObject
</code> instance.
2086 The third line tells the IDE (if
<code>@mixin
</code> is supported) that the database object editor decorates the database object and therefore offers autocompletion for properties and methods from the database object class itself.
</p>
2087 <h2 id=
"runtime-caches">Runtime Caches
<a class=
"headerlink" href=
"#runtime-caches" title=
"Permanent link">#
</a></h2>
2088 <h3 id=
"class-tags_1">Class Tags
<a class=
"headerlink" href=
"#class-tags_1" title=
"Permanent link">#
</a></h3>
2089 <p>Any class implementing the
<a href=
"https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/cache/runtime/IRuntimeCache.class.php">IRuntimeCache
</a> interface must have the following class tags:
</p>
2090 <table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal">1</span>
2091 <span class=
"normal">2</span>
2092 <span class=
"normal">3</span>
2093 <span class=
"normal">4</span>
2094 <span class=
"normal">5</span>
2095 <span class=
"normal">6</span></pre></div></td><td class=
"code"><div class=
"highlight"><pre><span></span><code><span class=
"sd">/**
</span>
2096 <span class=
"sd"> * …
</span>
2097 <span class=
"sd"> * @method {DBO class name}[] getCachedObjects()
</span>
2098 <span class=
"sd"> * @method {DBO class name} getObject($objectID)
</span>
2099 <span class=
"sd"> * @method {DBO class name}[] getObjects(array $objectIDs)
</span>
2100 <span class=
"sd"> */
</span>
2103 <p>These tags ensure that when calling any of the mentioned methods, the return value refers to the concrete database object and not just generically to
<a href=
"https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/data/DatabaseObject.class.php">DatabaseObject
</a>.
</p>
2109 <div class=
"md-source-date">
2112 Last update:
2021-
01-
08
2131 <footer class=
"md-footer">
2133 <div class=
"md-footer-meta md-typeset">
2134 <div class=
"md-footer-meta__inner md-grid">
2135 <div class=
"md-footer-copyright">
2137 <div class=
"md-footer-copyright__highlight">
2138 Copyright ©
2020 WoltLab GmbH
2142 <a href=
"https://squidfunk.github.io/mkdocs-material/" target=
"_blank" rel=
"noopener">
2147 <div class=
"md-footer-copyright">
2148 <a href=
"https://www.woltlab.com/legal-notice/">Legal Notice
</a>
2149 <a href=
"https://www.woltlab.com/privacy-policy/">Privacy Policy
</a>
2156 <div class=
"md-dialog" data-md-component=
"dialog">
2157 <div class=
"md-dialog__inner md-typeset"></div>
2159 <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>
2162 <script src=
"../../assets/javascripts/bundle.4ea5477f.min.js"></script>