Subversion Repositories php_users

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
26 rodolico 1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
    <meta charset="utf-8">
5
    <title>Documentation</title>
6
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
    <base href="../">
8
    <link rel="icon" href="images/favicon.ico"/>
9
    <link rel="stylesheet" href="css/normalize.css">
10
    <link rel="stylesheet" href="css/base.css">
11
            <link rel="preconnect" href="https://fonts.gstatic.com">
12
        <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
13
        <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
14
        <link rel="stylesheet" href="css/template.css">
15
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
16
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
17
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
18
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
19
                <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
20
        <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
21
        <script src="js/search.js"></script>
22
        <script defer src="js/searchIndex.js"></script>
23
    </head>
24
<body id="top">
25
    <header class="phpdocumentor-header phpdocumentor-section">
26
    <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
27
    <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
28
    <label class="phpdocumentor-header__menu-icon" for="menu-button">
29
        <i class="fas fa-bars"></i>
30
    </label>
31
    <section data-search-form class="phpdocumentor-search">
32
    <label>
33
        <span class="visually-hidden">Search for</span>
34
        <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
35
            <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
36
            <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
37
        </svg>
38
        <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
39
    </label>
40
</section>
41
 
42
    <nav class="phpdocumentor-topnav">
43
    <ul class="phpdocumentor-topnav__menu">
44
        </ul>
45
</nav>
46
</header>
47
 
48
    <main class="phpdocumentor">
49
        <div class="phpdocumentor-section">
50
            <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
51
<label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
52
    Menu
53
</label>
54
<aside class="phpdocumentor-column -four phpdocumentor-sidebar">
55
 
56
    <section class="phpdocumentor-sidebar__category">
57
        <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
58
            </section>
59
 
60
        <section class="phpdocumentor-sidebar__category">
61
        <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
62
                    <h3 class="phpdocumentor-sidebar__root-package"><a href="packages/Application.html"><abbr title="\Application">Application</abbr></a></h3>
63
                        </section>
64
 
65
    <section class="phpdocumentor-sidebar__category">
66
        <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
67
                <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
68
        <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
69
        <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
70
    </section>
71
 
72
    <section class="phpdocumentor-sidebar__category">
73
        <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
74
        <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
75
    </section>
76
</aside>
77
 
78
            <div class="phpdocumentor-column -eight phpdocumentor-content">
79
                    <ul class="phpdocumentor-breadcrumbs">
80
            <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
81
    </ul>
82
 
83
    <article class="phpdocumentor-element -class">
84
        <h2 class="phpdocumentor-content__title">
85
    usersDataSourceMySQLi
86
 
87
        <span class="phpdocumentor-element__extends">
88
        extends <a href="classes/usersDataSource.html"><abbr title="\usersDataSource">usersDataSource</abbr></a>
89
    </span>
90
 
91
            <div class="phpdocumentor-element__package">
92
            in package
93
            <ul class="phpdocumentor-breadcrumbs">
94
                                    <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
95
                            </ul>
96
        </div>
97
 
98
 
99
    </h2>
100
 
101
        <aside class="phpdocumentor-element-found-in">
102
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
103
    :
104
    <span class="phpdocumentor-element-found-in__line">65</span>
105
 
106
    </aside>
107
 
108
            <p class="phpdocumentor-summary">usersDataSource class</p>
109
 
110
    <section class="phpdocumentor-description"><p>usersDataSource provides the data access capabilities for the Users
111
class.</p>
112
<p>To build a data access class for Users, the following 5 methods must
113
exist.
114
getPassword(username)
115
getAllUsers()
116
getARecord
117
update</p>
118
<p>Additionally, where appropriate, the following function is useful
119
buildTable()</p>
120
<p>This particular instance provides an interface to MySQL using
121
the mysqli libraries.</p>
122
<p>Create an instance of this, then pass the variable to several Users
123
calls.</p>
124
</section>
125
 
126
 
127
 
128
 
129
 
130
 
131
 
132
 
133
<h3 id="toc">
134
    Table of Contents
135
    <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
136
</h3>
137
 
138
<dl class="phpdocumentor-table-of-contents">
139
                <dt class="phpdocumentor-table-of-contents__entry -property -protected">
140
    <a href="classes/usersDataSourceMySQLi.html#property_configuration">$configuration</a>
141
    <span>
142
                &nbsp;: array&lt;string|int, string&gt;            </span>
143
</dt>
144
<dd></dd>
145
 
146
            <dt class="phpdocumentor-table-of-contents__entry -property -protected">
147
    <a href="classes/usersDataSourceMySQLi.html#property_dbConnection">$dbConnection</a>
148
    <span>
149
                &nbsp;: <abbr title="\mysqli">mysqli</abbr>            </span>
150
</dt>
151
<dd></dd>
152
 
153
                <dt class="phpdocumentor-table-of-contents__entry -method -public">
154
    <a href="classes/usersDataSourceMySQLi.html#method___construct">__construct()</a>
155
    <span>
156
                        &nbsp;: null    </span>
157
</dt>
158
<dd>constructor for an instance of the class</dd>
159
 
160
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
161
    <a href="classes/usersDataSourceMySQLi.html#method_buildTable">buildTable()</a>
162
    <span>
163
                        &nbsp;: mixed    </span>
164
</dt>
165
<dd>Convenience function to create the tables defined in $configuration</dd>
166
 
167
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
168
    <a href="classes/usersDataSourceMySQLi.html#method_getAllUsers">getAllUsers()</a>
169
    <span>
170
                        &nbsp;: array&lt;string|int, string&gt;    </span>
171
</dt>
172
<dd>retrieves all users from the database</dd>
173
 
174
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
175
    <a href="classes/usersDataSourceMySQLi.html#method_getARecord">getARecord()</a>
176
    <span>
177
                        &nbsp;: array&lt;string|int, string&gt;    </span>
178
</dt>
179
<dd>Get a record from the database</dd>
180
 
181
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
182
    <a href="classes/usersDataSourceMySQLi.html#method_getPassword">getPassword()</a>
183
    <span>
184
                        &nbsp;: array&lt;string|int, string&gt;    </span>
185
</dt>
186
<dd>Retrieves the password field from table</dd>
187
 
188
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
189
    <a href="classes/usersDataSourceMySQLi.html#method_getUserID">getUserID()</a>
190
    <span>
191
                        &nbsp;: int    </span>
192
</dt>
193
<dd>retrieves the userID from the table</dd>
194
 
195
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
196
    <a href="classes/usersDataSourceMySQLi.html#method_initTables">initTables()</a>
197
    <span>
198
                        &nbsp;: mixed    </span>
199
</dt>
200
<dd>Convenience function to initialize tables to values</dd>
201
 
202
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
203
    <a href="classes/usersDataSourceMySQLi.html#method_test">test()</a>
204
    <span>
205
                        &nbsp;: bool    </span>
206
</dt>
207
<dd>Tests that the database connection works and the table is built</dd>
208
 
209
            <dt class="phpdocumentor-table-of-contents__entry -method -public">
210
    <a href="classes/usersDataSourceMySQLi.html#method_update">update()</a>
211
    <span>
212
                        &nbsp;: <abbr title="\mysqli_result">mysqli_result</abbr>|bool    </span>
213
</dt>
214
<dd>updates row in database with $newData</dd>
215
 
216
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
217
    <a href="classes/usersDataSourceMySQLi.html#method_buildQuery">buildQuery()</a>
218
    <span>
219
                        &nbsp;: string    </span>
220
</dt>
221
<dd>Create a query to retrieve info from database</dd>
222
 
223
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
224
    <a href="classes/usersDataSourceMySQLi.html#method_doSQL">doSQL()</a>
225
    <span>
226
                        &nbsp;: mixed    </span>
227
</dt>
228
<dd>Executes an SQL statement, returning the result</dd>
229
 
230
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
231
    <a href="classes/usersDataSourceMySQLi.html#method_escapeString">escapeString()</a>
232
    <span>
233
                        &nbsp;: string    </span>
234
</dt>
235
<dd>Make string safe for MySQL</dd>
236
 
237
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
238
    <a href="classes/usersDataSourceMySQLi.html#method_getAField">getAField()</a>
239
    <span>
240
                        &nbsp;: mixed    </span>
241
</dt>
242
<dd>Gets a single field from a table</dd>
243
 
244
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
245
    <a href="classes/usersDataSourceMySQLi.html#method_setDBConnection">setDBConnection()</a>
246
    <span>
247
                        &nbsp;: <abbr title="\mysqli">mysqli</abbr>|false    </span>
248
</dt>
249
<dd>Make the database connection</dd>
250
 
251
            <dt class="phpdocumentor-table-of-contents__entry -method -protected">
252
    <a href="classes/usersDataSourceMySQLi.html#method_tableColumnName">tableColumnName()</a>
253
    <span>
254
                        &nbsp;: string    </span>
255
</dt>
256
<dd>Gets the actual database column name from the configuration file</dd>
257
 
258
        </dl>
259
 
260
 
261
 
262
 
263
 
264
 
265
    <section class="phpdocumentor-properties">
266
        <h3 class="phpdocumentor-elements__header" id="properties">
267
            Properties
268
            <a href="classes/usersDataSourceMySQLi.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
269
        </h3>
270
                    <article
271
        class="
272
            phpdocumentor-element
273
            -property
274
            -protected
275
                                                        "
276
>
277
    <h4 class="phpdocumentor-element__name" id="property_configuration">
278
        $configuration
279
        <a href="classes/usersDataSourceMySQLi.html#property_configuration" class="headerlink"><i class="fas fa-link"></i></a>
280
        <span class="phpdocumentor-element__modifiers">
281
                                </span>
282
    </h4>
283
    <aside class="phpdocumentor-element-found-in">
284
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
285
    :
286
    <span class="phpdocumentor-element-found-in__line">72</span>
287
 
288
    </aside>
289
 
290
 
291
    <code class="phpdocumentor-code phpdocumentor-signature ">
292
    <span class="phpdocumentor-signature__visibility">protected</span>
293
        <span class="phpdocumentor-signature__type">array&lt;string|int, string&gt;</span>
294
    <span class="phpdocumentor-signature__name">$configuration</span>
295
     = <span class="phpdocumentor-signature__default-value">array(&#039;tables&#039; =&gt; array(&#039;users&#039; =&gt; array(
296
    &#039;table&#039; =&gt; &#039;_users&#039;,
297
    // table name for user records
298
    &#039;id&#039; =&gt; &#039;_user_id&#039;,
299
    // ID column name
300
    &#039;display&#039; =&gt; array(
301
        // fields which are displayed to select
302
        &#039;login&#039;,
303
    ),
304
    &#039;password&#039; =&gt; array(
305
        // These fields are stored encrypted
306
        &#039;pass&#039;,
307
    ),
308
    &#039;fields&#039; =&gt; array(&#039;login&#039; =&gt; array(
309
        &#039;dbColumn&#039; =&gt; &#039;login&#039;,
310
        // login name column name
311
        &#039;type&#039; =&gt; &#039;varchar&#039;,
312
        &#039;size&#039; =&gt; 64,
313
        &#039;required&#039; =&gt; 	rue,
314
        &#039;unique&#039; =&gt; 	rue,
315
    ), &#039;pass&#039; =&gt; array(
316
        &#039;dbColumn&#039; =&gt; &#039;password&#039;,
317
        // password column name
318
        &#039;type&#039; =&gt; &#039;varchar&#039;,
319
        &#039;size&#039; =&gt; 128,
320
        &#039;required&#039; =&gt; 	rue,
321
    ), &#039;admin&#039; =&gt; array(&#039;dbColumn&#039; =&gt; &#039;isAdmin&#039;, &#039;type&#039; =&gt; &#039;boolean&#039;, &#039;required&#039; =&gt; 	rue, &#039;default&#039; =&gt; &#039;0&#039;), &#039;enabled&#039; =&gt; array(&#039;dbColumn&#039; =&gt; &#039;enabled&#039;, &#039;type&#039; =&gt; &#039;boolean&#039;, &#039;required&#039; =&gt; 	rue, &#039;default&#039; =&gt; &#039;1&#039;)),
322
)))</span></code>
323
 
324
 
325
        <section class="phpdocumentor-description"><p>Contains the configuration for the class</p>
326
<p>May be modified by the calling program. Must be replicated in userDataSource class</p>
327
</section>
328
 
329
 
330
 
331
</article>
332
                    <article
333
        class="
334
            phpdocumentor-element
335
            -property
336
            -protected
337
                                                        "
338
>
339
    <h4 class="phpdocumentor-element__name" id="property_dbConnection">
340
        $dbConnection
341
        <a href="classes/usersDataSourceMySQLi.html#property_dbConnection" class="headerlink"><i class="fas fa-link"></i></a>
342
        <span class="phpdocumentor-element__modifiers">
343
                                </span>
344
    </h4>
345
    <aside class="phpdocumentor-element-found-in">
346
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
347
    :
348
    <span class="phpdocumentor-element-found-in__line">114</span>
349
 
350
    </aside>
351
 
352
 
353
    <code class="phpdocumentor-code phpdocumentor-signature ">
354
    <span class="phpdocumentor-signature__visibility">protected</span>
355
        <span class="phpdocumentor-signature__type"><abbr title="\mysqli">mysqli</abbr></span>
356
    <span class="phpdocumentor-signature__name">$dbConnection</span>
357
     = <span class="phpdocumentor-signature__default-value">alse</span></code>
358
 
359
 
360
        <section class="phpdocumentor-description"><p>Holds the mysqli database connection</p>
361
</section>
362
 
363
 
364
 
365
</article>
366
            </section>
367
 
368
            <section class="phpdocumentor-methods">
369
        <h3 class="phpdocumentor-elements__header" id="methods">
370
            Methods
371
            <a href="classes/usersDataSourceMySQLi.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
372
        </h3>
373
                    <article
374
        class="phpdocumentor-element
375
            -method
376
            -public
377
                                                        "
378
>
379
    <h4 class="phpdocumentor-element__name" id="method___construct">
380
        __construct()
381
        <a href="classes/usersDataSourceMySQLi.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
382
    </h4>
383
    <aside class="phpdocumentor-element-found-in">
384
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
385
    :
386
    <span class="phpdocumentor-element-found-in__line">131</span>
387
 
388
    </aside>
389
 
390
        <p class="phpdocumentor-summary">constructor for an instance of the class</p>
391
 
392
    <code class="phpdocumentor-code phpdocumentor-signature ">
393
    <span class="phpdocumentor-signature__visibility">public</span>
394
                <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$connection</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$customFields</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">array()</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">null</span></code>
395
 
396
        <section class="phpdocumentor-description"><p>If $dbConnection is not null, will be used for database access
397
If $dbLoginInfo is not null, will override $dbConnection, make
398
a new connection and use that.</p>
399
<p>If $dbDef is set, will be merged with $configuration</p>
400
</section>
401
 
402
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
403
    <dl class="phpdocumentor-argument-list">
404
                    <dt class="phpdocumentor-argument-list__entry">
405
                <span class="phpdocumentor-signature__argument__name">$connection</span>
406
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
407
                            </dt>
408
            <dd class="phpdocumentor-argument-list__definition">
409
                    <section class="phpdocumentor-description"></section>
410
 
411
            </dd>
412
                    <dt class="phpdocumentor-argument-list__entry">
413
                <span class="phpdocumentor-signature__argument__name">$customFields</span>
414
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
415
                 = <span class="phpdocumentor-signature__argument__default-value">array()</span>            </dt>
416
            <dd class="phpdocumentor-argument-list__definition">
417
                    <section class="phpdocumentor-description"></section>
418
 
419
            </dd>
420
            </dl>
421
 
422
 
423
 
424
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
425
    <span class="phpdocumentor-signature__response_type">null</span>
426
            &mdash;
427
 
428
 
429
</article>
430
                    <article
431
        class="phpdocumentor-element
432
            -method
433
            -public
434
                                                        "
435
>
436
    <h4 class="phpdocumentor-element__name" id="method_buildTable">
437
        buildTable()
438
        <a href="classes/usersDataSourceMySQLi.html#method_buildTable" class="headerlink"><i class="fas fa-link"></i></a>
439
    </h4>
440
    <aside class="phpdocumentor-element-found-in">
441
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
442
    :
443
    <span class="phpdocumentor-element-found-in__line">273</span>
444
 
445
    </aside>
446
 
447
        <p class="phpdocumentor-summary">Convenience function to create the tables defined in $configuration</p>
448
 
449
    <code class="phpdocumentor-code phpdocumentor-signature ">
450
    <span class="phpdocumentor-signature__visibility">public</span>
451
                <span class="phpdocumentor-signature__name">buildTable</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
452
 
453
        <section class="phpdocumentor-description"><p>Using $configuration, build the table (replacing the current one)
454
then add $username with $password, setting as admin</p>
455
</section>
456
 
457
 
458
 
459
 
460
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
461
    <span class="phpdocumentor-signature__response_type">mixed</span>
462
            &mdash;
463
 
464
 
465
</article>
466
                    <article
467
        class="phpdocumentor-element
468
            -method
469
            -public
470
                                                        "
471
>
472
    <h4 class="phpdocumentor-element__name" id="method_getAllUsers">
473
        getAllUsers()
474
        <a href="classes/usersDataSourceMySQLi.html#method_getAllUsers" class="headerlink"><i class="fas fa-link"></i></a>
475
    </h4>
476
    <aside class="phpdocumentor-element-found-in">
477
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
478
    :
479
    <span class="phpdocumentor-element-found-in__line">420</span>
480
 
481
    </aside>
482
 
483
        <p class="phpdocumentor-summary">retrieves all users from the database</p>
484
 
485
    <code class="phpdocumentor-code phpdocumentor-signature ">
486
    <span class="phpdocumentor-signature__visibility">public</span>
487
                <span class="phpdocumentor-signature__name">getAllUsers</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span></code>
488
 
489
        <section class="phpdocumentor-description"><p>Retrieves all data for all users from table</p>
490
</section>
491
 
492
 
493
 
494
 
495
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
496
    <span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span>
497
            &mdash;
498
            <section class="phpdocumentor-description"><p>array of array of rows/columns</p>
499
</section>
500
 
501
 
502
</article>
503
                    <article
504
        class="phpdocumentor-element
505
            -method
506
            -public
507
                                                        "
508
>
509
    <h4 class="phpdocumentor-element__name" id="method_getARecord">
510
        getARecord()
511
        <a href="classes/usersDataSourceMySQLi.html#method_getARecord" class="headerlink"><i class="fas fa-link"></i></a>
512
    </h4>
513
    <aside class="phpdocumentor-element-found-in">
514
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
515
    :
516
    <span class="phpdocumentor-element-found-in__line">215</span>
517
 
518
    </aside>
519
 
520
        <p class="phpdocumentor-summary">Get a record from the database</p>
521
 
522
    <code class="phpdocumentor-code phpdocumentor-signature ">
523
    <span class="phpdocumentor-signature__visibility">public</span>
524
                <span class="phpdocumentor-signature__name">getARecord</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$whereFields</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$fieldList</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span></code>
525
 
526
        <section class="phpdocumentor-description"><p>Gets a single record from the database which matches $field containing
527
$username. If more than one record is returned, will return the first
528
one</p>
529
</section>
530
 
531
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
532
    <dl class="phpdocumentor-argument-list">
533
                    <dt class="phpdocumentor-argument-list__entry">
534
                <span class="phpdocumentor-signature__argument__name">$whereFields</span>
535
                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;</span>
536
                            </dt>
537
            <dd class="phpdocumentor-argument-list__definition">
538
                    <section class="phpdocumentor-description"><p>column=&gt;value pairs for where clause</p>
539
</section>
540
 
541
            </dd>
542
                    <dt class="phpdocumentor-argument-list__entry">
543
                <span class="phpdocumentor-signature__argument__name">$fieldList</span>
544
                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;</span>
545
                 = <span class="phpdocumentor-signature__argument__default-value">null</span>            </dt>
546
            <dd class="phpdocumentor-argument-list__definition">
547
                    <section class="phpdocumentor-description"><p>a list of columns to return. If empty, returns all columns</p>
548
</section>
549
 
550
            </dd>
551
            </dl>
552
 
553
 
554
 
555
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
556
    <span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span>
557
            &mdash;
558
            <section class="phpdocumentor-description"><p>a hash containing fieldname=&gt;value pairs from fetch_assoc</p>
559
</section>
560
 
561
 
562
</article>
563
                    <article
564
        class="phpdocumentor-element
565
            -method
566
            -public
567
                                                        "
568
>
569
    <h4 class="phpdocumentor-element__name" id="method_getPassword">
570
        getPassword()
571
        <a href="classes/usersDataSourceMySQLi.html#method_getPassword" class="headerlink"><i class="fas fa-link"></i></a>
572
    </h4>
573
    <aside class="phpdocumentor-element-found-in">
574
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
575
    :
576
    <span class="phpdocumentor-element-found-in__line">234</span>
577
 
578
    </aside>
579
 
580
        <p class="phpdocumentor-summary">Retrieves the password field from table</p>
581
 
582
    <code class="phpdocumentor-code phpdocumentor-signature ">
583
    <span class="phpdocumentor-signature__visibility">public</span>
584
                <span class="phpdocumentor-signature__name">getPassword</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$username</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span></code>
585
 
586
        <section class="phpdocumentor-description"><p>Note that the password is stored as a hash in the table</p>
587
</section>
588
 
589
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
590
    <dl class="phpdocumentor-argument-list">
591
                    <dt class="phpdocumentor-argument-list__entry">
592
                <span class="phpdocumentor-signature__argument__name">$username</span>
593
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
594
                            </dt>
595
            <dd class="phpdocumentor-argument-list__definition">
596
                    <section class="phpdocumentor-description"><p>username used to find record</p>
597
</section>
598
 
599
            </dd>
600
            </dl>
601
 
602
 
603
 
604
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
605
    <span class="phpdocumentor-signature__response_type">array&lt;string|int, string&gt;</span>
606
            &mdash;
607
            <section class="phpdocumentor-description"><p>an array of values key/value pairs</p>
608
</section>
609
 
610
 
611
</article>
612
                    <article
613
        class="phpdocumentor-element
614
            -method
615
            -public
616
                                                        "
617
>
618
    <h4 class="phpdocumentor-element__name" id="method_getUserID">
619
        getUserID()
620
        <a href="classes/usersDataSourceMySQLi.html#method_getUserID" class="headerlink"><i class="fas fa-link"></i></a>
621
    </h4>
622
    <aside class="phpdocumentor-element-found-in">
623
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
624
    :
625
    <span class="phpdocumentor-element-found-in__line">244</span>
626
 
627
    </aside>
628
 
629
        <p class="phpdocumentor-summary">retrieves the userID from the table</p>
630
 
631
    <code class="phpdocumentor-code phpdocumentor-signature ">
632
    <span class="phpdocumentor-signature__visibility">public</span>
633
                <span class="phpdocumentor-signature__name">getUserID</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$username</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
634
 
635
 
636
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
637
    <dl class="phpdocumentor-argument-list">
638
                    <dt class="phpdocumentor-argument-list__entry">
639
                <span class="phpdocumentor-signature__argument__name">$username</span>
640
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
641
                            </dt>
642
            <dd class="phpdocumentor-argument-list__definition">
643
 
644
            </dd>
645
            </dl>
646
 
647
 
648
 
649
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
650
    <span class="phpdocumentor-signature__response_type">int</span>
651
            &mdash;
652
            <section class="phpdocumentor-description"><p>user id</p>
653
</section>
654
 
655
 
656
</article>
657
                    <article
658
        class="phpdocumentor-element
659
            -method
660
            -public
661
                                                        "
662
>
663
    <h4 class="phpdocumentor-element__name" id="method_initTables">
664
        initTables()
665
        <a href="classes/usersDataSourceMySQLi.html#method_initTables" class="headerlink"><i class="fas fa-link"></i></a>
666
    </h4>
667
    <aside class="phpdocumentor-element-found-in">
668
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
669
    :
670
    <span class="phpdocumentor-element-found-in__line">312</span>
671
 
672
    </aside>
673
 
674
        <p class="phpdocumentor-summary">Convenience function to initialize tables to values</p>
675
 
676
    <code class="phpdocumentor-code phpdocumentor-signature ">
677
    <span class="phpdocumentor-signature__visibility">public</span>
678
                <span class="phpdocumentor-signature__name">initTables</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$initValues</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
679
 
680
 
681
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
682
    <dl class="phpdocumentor-argument-list">
683
                    <dt class="phpdocumentor-argument-list__entry">
684
                <span class="phpdocumentor-signature__argument__name">$initValues</span>
685
                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;</span>
686
                            </dt>
687
            <dd class="phpdocumentor-argument-list__definition">
688
                    <section class="phpdocumentor-description"><p>Array of tablenames, column names and values</p>
689
</section>
690
 
691
            </dd>
692
            </dl>
693
 
694
 
695
 
696
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
697
    <span class="phpdocumentor-signature__response_type">mixed</span>
698
            &mdash;
699
 
700
 
701
</article>
702
                    <article
703
        class="phpdocumentor-element
704
            -method
705
            -public
706
                                                        "
707
>
708
    <h4 class="phpdocumentor-element__name" id="method_test">
709
        test()
710
        <a href="classes/usersDataSourceMySQLi.html#method_test" class="headerlink"><i class="fas fa-link"></i></a>
711
    </h4>
712
    <aside class="phpdocumentor-element-found-in">
713
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
714
    :
715
    <span class="phpdocumentor-element-found-in__line">366</span>
716
 
717
    </aside>
718
 
719
        <p class="phpdocumentor-summary">Tests that the database connection works and the table is built</p>
720
 
721
    <code class="phpdocumentor-code phpdocumentor-signature ">
722
    <span class="phpdocumentor-signature__visibility">public</span>
723
                <span class="phpdocumentor-signature__name">test</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
724
 
725
 
726
 
727
 
728
 
729
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
730
    <span class="phpdocumentor-signature__response_type">bool</span>
731
            &mdash;
732
            <section class="phpdocumentor-description"><p>True if table exists (does not verify columns)</p>
733
</section>
734
 
735
 
736
</article>
737
                    <article
738
        class="phpdocumentor-element
739
            -method
740
            -public
741
                                                        "
742
>
743
    <h4 class="phpdocumentor-element__name" id="method_update">
744
        update()
745
        <a href="classes/usersDataSourceMySQLi.html#method_update" class="headerlink"><i class="fas fa-link"></i></a>
746
    </h4>
747
    <aside class="phpdocumentor-element-found-in">
748
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
749
    :
750
    <span class="phpdocumentor-element-found-in__line">379</span>
751
 
752
    </aside>
753
 
754
        <p class="phpdocumentor-summary">updates row in database with $newData</p>
755
 
756
    <code class="phpdocumentor-code phpdocumentor-signature ">
757
    <span class="phpdocumentor-signature__visibility">public</span>
758
                <span class="phpdocumentor-signature__name">update</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$newData</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\mysqli_result">mysqli_result</abbr>|bool</span></code>
759
 
760
 
761
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
762
    <dl class="phpdocumentor-argument-list">
763
                    <dt class="phpdocumentor-argument-list__entry">
764
                <span class="phpdocumentor-signature__argument__name">$newData</span>
765
                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;</span>
766
                            </dt>
767
            <dd class="phpdocumentor-argument-list__definition">
768
                    <section class="phpdocumentor-description"><p>fieldname/value pairs to be updated in table</p>
769
</section>
770
 
771
            </dd>
772
            </dl>
773
 
774
 
775
 
776
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
777
    <span class="phpdocumentor-signature__response_type"><abbr title="\mysqli_result">mysqli_result</abbr>|bool</span>
778
            &mdash;
779
            <section class="phpdocumentor-description"><p>The mysqli result from a query</p>
780
</section>
781
 
782
 
783
</article>
784
                    <article
785
        class="phpdocumentor-element
786
            -method
787
            -protected
788
                                                        "
789
>
790
    <h4 class="phpdocumentor-element__name" id="method_buildQuery">
791
        buildQuery()
792
        <a href="classes/usersDataSourceMySQLi.html#method_buildQuery" class="headerlink"><i class="fas fa-link"></i></a>
793
    </h4>
794
    <aside class="phpdocumentor-element-found-in">
795
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
796
    :
797
    <span class="phpdocumentor-element-found-in__line">175</span>
798
 
799
    </aside>
800
 
801
        <p class="phpdocumentor-summary">Create a query to retrieve info from database</p>
802
 
803
    <code class="phpdocumentor-code phpdocumentor-signature ">
804
    <span class="phpdocumentor-signature__visibility">protected</span>
805
                <span class="phpdocumentor-signature__name">buildQuery</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$whereFields</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$fieldList</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
806
 
807
        <section class="phpdocumentor-description"><p>Builds a query to retrieve records from the database. With all
808
parameters set to null, will retrieve all columns and records
809
Setting $field and $toFind create a where clause, and setting
810
$fieldList as a has (ie, 'fieldname' =&gt; 1) will limit the
811
fields returned</p>
812
</section>
813
 
814
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
815
    <dl class="phpdocumentor-argument-list">
816
                    <dt class="phpdocumentor-argument-list__entry">
817
                <span class="phpdocumentor-signature__argument__name">$whereFields</span>
818
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
819
                            </dt>
820
            <dd class="phpdocumentor-argument-list__definition">
821
                    <section class="phpdocumentor-description"></section>
822
 
823
            </dd>
824
                    <dt class="phpdocumentor-argument-list__entry">
825
                <span class="phpdocumentor-signature__argument__name">$fieldList</span>
826
                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;</span>
827
                 = <span class="phpdocumentor-signature__argument__default-value">null</span>            </dt>
828
            <dd class="phpdocumentor-argument-list__definition">
829
                    <section class="phpdocumentor-description"><p>a hash where the keys make a list of columns to return. If empty, returns all columns</p>
830
</section>
831
 
832
            </dd>
833
            </dl>
834
 
835
 
836
 
837
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
838
    <span class="phpdocumentor-signature__response_type">string</span>
839
            &mdash;
840
            <section class="phpdocumentor-description"><p>A cleaned and formatted SQL Query</p>
841
</section>
842
 
843
 
844
</article>
845
                    <article
846
        class="phpdocumentor-element
847
            -method
848
            -protected
849
                                                        "
850
>
851
    <h4 class="phpdocumentor-element__name" id="method_doSQL">
852
        doSQL()
853
        <a href="classes/usersDataSourceMySQLi.html#method_doSQL" class="headerlink"><i class="fas fa-link"></i></a>
854
    </h4>
855
    <aside class="phpdocumentor-element-found-in">
856
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
857
    :
858
    <span class="phpdocumentor-element-found-in__line">445</span>
859
 
860
    </aside>
861
 
862
        <p class="phpdocumentor-summary">Executes an SQL statement, returning the result</p>
863
 
864
    <code class="phpdocumentor-code phpdocumentor-signature ">
865
    <span class="phpdocumentor-signature__visibility">protected</span>
866
                <span class="phpdocumentor-signature__name">doSQL</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$query</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$comment</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">&#039;&#039;</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
867
 
868
        <section class="phpdocumentor-description"><p>This simply runs mysqli::query, and returns the value of that</p>
869
<p>Created for testing and debugging, if the second parameter is
870
true, will NOT execute the query, but will instead display the
871
query passed.</p>
872
</section>
873
 
874
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
875
    <dl class="phpdocumentor-argument-list">
876
                    <dt class="phpdocumentor-argument-list__entry">
877
                <span class="phpdocumentor-signature__argument__name">$query</span>
878
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
879
                            </dt>
880
            <dd class="phpdocumentor-argument-list__definition">
881
                    <section class="phpdocumentor-description"></section>
882
 
883
            </dd>
884
                    <dt class="phpdocumentor-argument-list__entry">
885
                <span class="phpdocumentor-signature__argument__name">$comment</span>
886
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
887
                 = <span class="phpdocumentor-signature__argument__default-value">&#039;&#039;</span>            </dt>
888
            <dd class="phpdocumentor-argument-list__definition">
889
                    <section class="phpdocumentor-description"></section>
890
 
891
            </dd>
892
            </dl>
893
 
894
 
895
    <h5 class="phpdocumentor-tag-list__heading" id="tags">
896
        Tags
897
        <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
898
    </h5>
899
    <dl class="phpdocumentor-tag-list">
900
                                    <dt class="phpdocumentor-tag-list__entry">
901
                    <span class="phpdocumentor-tag__name">parameter</span>
902
                </dt>
903
                <dd class="phpdocumentor-tag-list__definition">
904
 
905
                                                 <section class="phpdocumentor-description"><p>string $query SQL Query to execute</p>
906
</section>
907
 
908
                                    </dd>
909
                            <dt class="phpdocumentor-tag-list__entry">
910
                    <span class="phpdocumentor-tag__name">parameter</span>
911
                </dt>
912
                <dd class="phpdocumentor-tag-list__definition">
913
 
914
                                                 <section class="phpdocumentor-description"><p>string $comment if not empty, writes comment and query to a file</p>
915
</section>
916
 
917
                                    </dd>
918
                                                <dt class="phpdocumentor-tag-list__entry">
919
                    <span class="phpdocumentor-tag__name">returns</span>
920
                </dt>
921
                <dd class="phpdocumentor-tag-list__definition">
922
 
923
                                                 <section class="phpdocumentor-description"><p>mysqli_result</p>
924
</section>
925
 
926
                                    </dd>
927
                        </dl>
928
 
929
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
930
    <span class="phpdocumentor-signature__response_type">mixed</span>
931
            &mdash;
932
 
933
 
934
</article>
935
                    <article
936
        class="phpdocumentor-element
937
            -method
938
            -protected
939
                                                        "
940
>
941
    <h4 class="phpdocumentor-element__name" id="method_escapeString">
942
        escapeString()
943
        <a href="classes/usersDataSourceMySQLi.html#method_escapeString" class="headerlink"><i class="fas fa-link"></i></a>
944
    </h4>
945
    <aside class="phpdocumentor-element-found-in">
946
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
947
    :
948
    <span class="phpdocumentor-element-found-in__line">151</span>
949
 
950
    </aside>
951
 
952
        <p class="phpdocumentor-summary">Make string safe for MySQL</p>
953
 
954
    <code class="phpdocumentor-code phpdocumentor-signature ">
955
    <span class="phpdocumentor-signature__visibility">protected</span>
956
                <span class="phpdocumentor-signature__name">escapeString</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$string</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
957
 
958
        <section class="phpdocumentor-description"><p>If the string is completely numeric, returns it, otherwise
959
puts single quotes around it</p>
960
</section>
961
 
962
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
963
    <dl class="phpdocumentor-argument-list">
964
                    <dt class="phpdocumentor-argument-list__entry">
965
                <span class="phpdocumentor-signature__argument__name">$string</span>
966
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
967
                            </dt>
968
            <dd class="phpdocumentor-argument-list__definition">
969
                    <section class="phpdocumentor-description"><p>The string to be fixed</p>
970
</section>
971
 
972
            </dd>
973
            </dl>
974
 
975
 
976
 
977
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
978
    <span class="phpdocumentor-signature__response_type">string</span>
979
            &mdash;
980
            <section class="phpdocumentor-description"><p>A copy of the string, ready for SQL</p>
981
</section>
982
 
983
 
984
</article>
985
                    <article
986
        class="phpdocumentor-element
987
            -method
988
            -protected
989
                                                        "
990
>
991
    <h4 class="phpdocumentor-element__name" id="method_getAField">
992
        getAField()
993
        <a href="classes/usersDataSourceMySQLi.html#method_getAField" class="headerlink"><i class="fas fa-link"></i></a>
994
    </h4>
995
    <aside class="phpdocumentor-element-found-in">
996
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
997
    :
998
    <span class="phpdocumentor-element-found-in__line">471</span>
999
 
1000
    </aside>
1001
 
1002
        <p class="phpdocumentor-summary">Gets a single field from a table</p>
1003
 
1004
    <code class="phpdocumentor-code phpdocumentor-signature ">
1005
    <span class="phpdocumentor-signature__visibility">protected</span>
1006
                <span class="phpdocumentor-signature__name">getAField</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$tableName</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$returnColumn</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$fieldName</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">mixed&nbsp;</span><span class="phpdocumentor-signature__argument__name">$value</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
1007
 
1008
        <section class="phpdocumentor-description"><p>Builds a query similar to
1009
select $returnColumn from $tableName where $fieldName = $value
1010
executes it, and returns the first column of the first
1011
row returned, or null if it does not exist.</p>
1012
</section>
1013
 
1014
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1015
    <dl class="phpdocumentor-argument-list">
1016
                    <dt class="phpdocumentor-argument-list__entry">
1017
                <span class="phpdocumentor-signature__argument__name">$tableName</span>
1018
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
1019
                            </dt>
1020
            <dd class="phpdocumentor-argument-list__definition">
1021
                    <section class="phpdocumentor-description"></section>
1022
 
1023
            </dd>
1024
                    <dt class="phpdocumentor-argument-list__entry">
1025
                <span class="phpdocumentor-signature__argument__name">$returnColumn</span>
1026
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
1027
                            </dt>
1028
            <dd class="phpdocumentor-argument-list__definition">
1029
                    <section class="phpdocumentor-description"></section>
1030
 
1031
            </dd>
1032
                    <dt class="phpdocumentor-argument-list__entry">
1033
                <span class="phpdocumentor-signature__argument__name">$fieldName</span>
1034
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
1035
                            </dt>
1036
            <dd class="phpdocumentor-argument-list__definition">
1037
                    <section class="phpdocumentor-description"></section>
1038
 
1039
            </dd>
1040
                    <dt class="phpdocumentor-argument-list__entry">
1041
                <span class="phpdocumentor-signature__argument__name">$value</span>
1042
                : <span class="phpdocumentor-signature__argument__return-type">mixed</span>
1043
                            </dt>
1044
            <dd class="phpdocumentor-argument-list__definition">
1045
                    <section class="phpdocumentor-description"></section>
1046
 
1047
            </dd>
1048
            </dl>
1049
 
1050
 
1051
    <h5 class="phpdocumentor-tag-list__heading" id="tags">
1052
        Tags
1053
        <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
1054
    </h5>
1055
    <dl class="phpdocumentor-tag-list">
1056
                                    <dt class="phpdocumentor-tag-list__entry">
1057
                    <span class="phpdocumentor-tag__name">parameter</span>
1058
                </dt>
1059
                <dd class="phpdocumentor-tag-list__definition">
1060
 
1061
                                                 <section class="phpdocumentor-description"><p>string $tableName Name of database table</p>
1062
</section>
1063
 
1064
                                    </dd>
1065
                            <dt class="phpdocumentor-tag-list__entry">
1066
                    <span class="phpdocumentor-tag__name">parameter</span>
1067
                </dt>
1068
                <dd class="phpdocumentor-tag-list__definition">
1069
 
1070
                                                 <section class="phpdocumentor-description"><p>string $returnColumn Column to return</p>
1071
</section>
1072
 
1073
                                    </dd>
1074
                            <dt class="phpdocumentor-tag-list__entry">
1075
                    <span class="phpdocumentor-tag__name">parameter</span>
1076
                </dt>
1077
                <dd class="phpdocumentor-tag-list__definition">
1078
 
1079
                                                 <section class="phpdocumentor-description"><p>string $fieldName Name of column to search for value</p>
1080
</section>
1081
 
1082
                                    </dd>
1083
                            <dt class="phpdocumentor-tag-list__entry">
1084
                    <span class="phpdocumentor-tag__name">parameter</span>
1085
                </dt>
1086
                <dd class="phpdocumentor-tag-list__definition">
1087
 
1088
                                                 <section class="phpdocumentor-description"><p>string $value The value to match</p>
1089
</section>
1090
 
1091
                                    </dd>
1092
                                                <dt class="phpdocumentor-tag-list__entry">
1093
                    <span class="phpdocumentor-tag__name">returns</span>
1094
                </dt>
1095
                <dd class="phpdocumentor-tag-list__definition">
1096
 
1097
                                                 <section class="phpdocumentor-description"><p>string $returnColumn of first row, or null if none</p>
1098
</section>
1099
 
1100
                                    </dd>
1101
                        </dl>
1102
 
1103
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1104
    <span class="phpdocumentor-signature__response_type">mixed</span>
1105
            &mdash;
1106
 
1107
 
1108
</article>
1109
                    <article
1110
        class="phpdocumentor-element
1111
            -method
1112
            -protected
1113
                                                        "
1114
>
1115
    <h4 class="phpdocumentor-element__name" id="method_setDBConnection">
1116
        setDBConnection()
1117
        <a href="classes/usersDataSourceMySQLi.html#method_setDBConnection" class="headerlink"><i class="fas fa-link"></i></a>
1118
    </h4>
1119
    <aside class="phpdocumentor-element-found-in">
1120
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
1121
    :
1122
    <span class="phpdocumentor-element-found-in__line">255</span>
1123
 
1124
    </aside>
1125
 
1126
        <p class="phpdocumentor-summary">Make the database connection</p>
1127
 
1128
    <code class="phpdocumentor-code phpdocumentor-signature ">
1129
    <span class="phpdocumentor-signature__visibility">protected</span>
1130
                <span class="phpdocumentor-signature__name">setDBConnection</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$parameters</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\mysqli">mysqli</abbr>|false</span></code>
1131
 
1132
 
1133
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1134
    <dl class="phpdocumentor-argument-list">
1135
                    <dt class="phpdocumentor-argument-list__entry">
1136
                <span class="phpdocumentor-signature__argument__name">$parameters</span>
1137
                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, string&gt;</span>
1138
                            </dt>
1139
            <dd class="phpdocumentor-argument-list__definition">
1140
                    <section class="phpdocumentor-description"><p>Parameters for makeing the connection</p>
1141
</section>
1142
 
1143
            </dd>
1144
            </dl>
1145
 
1146
 
1147
 
1148
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1149
    <span class="phpdocumentor-signature__response_type"><abbr title="\mysqli">mysqli</abbr>|false</span>
1150
            &mdash;
1151
 
1152
 
1153
</article>
1154
                    <article
1155
        class="phpdocumentor-element
1156
            -method
1157
            -protected
1158
                                                        "
1159
>
1160
    <h4 class="phpdocumentor-element__name" id="method_tableColumnName">
1161
        tableColumnName()
1162
        <a href="classes/usersDataSourceMySQLi.html#method_tableColumnName" class="headerlink"><i class="fas fa-link"></i></a>
1163
    </h4>
1164
    <aside class="phpdocumentor-element-found-in">
1165
    <abbr class="phpdocumentor-element-found-in__file" title="UsersDataSourceMySQLi.class.php"><a href="files/usersdatasourcemysqli-class.html"><abbr title="UsersDataSourceMySQLi.class.php">UsersDataSourceMySQLi.class.php</abbr></a></abbr>
1166
    :
1167
    <span class="phpdocumentor-element-found-in__line">347</span>
1168
 
1169
    </aside>
1170
 
1171
        <p class="phpdocumentor-summary">Gets the actual database column name from the configuration file</p>
1172
 
1173
    <code class="phpdocumentor-code phpdocumentor-signature ">
1174
    <span class="phpdocumentor-signature__visibility">protected</span>
1175
                <span class="phpdocumentor-signature__name">tableColumnName</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$table</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$field</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">&#039;&#039;</span><span> ]</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type">bool&nbsp;</span><span class="phpdocumentor-signature__argument__name">$fullTableColumn</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">false</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
1176
 
1177
        <section class="phpdocumentor-description"><p>Since we use a lot of indirection, this is a handy function which
1178
allows us to replace something like
1179
$this-&gt;configuration['tables']['users']['fields']['name']['dbColumn']
1180
with
1181
$this-&gt;tableColumnName( 'users', 'name' )</p>
1182
<p>If called with only one parameter (the table), will return the
1183
actual database table name</p>
1184
</section>
1185
 
1186
        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
1187
    <dl class="phpdocumentor-argument-list">
1188
                    <dt class="phpdocumentor-argument-list__entry">
1189
                <span class="phpdocumentor-signature__argument__name">$table</span>
1190
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
1191
                            </dt>
1192
            <dd class="phpdocumentor-argument-list__definition">
1193
                    <section class="phpdocumentor-description"><p>Name of Table</p>
1194
</section>
1195
 
1196
            </dd>
1197
                    <dt class="phpdocumentor-argument-list__entry">
1198
                <span class="phpdocumentor-signature__argument__name">$field</span>
1199
                : <span class="phpdocumentor-signature__argument__return-type">string</span>
1200
                 = <span class="phpdocumentor-signature__argument__default-value">&#039;&#039;</span>            </dt>
1201
            <dd class="phpdocumentor-argument-list__definition">
1202
                    <section class="phpdocumentor-description"><p>Name of field in $table</p>
1203
</section>
1204
 
1205
            </dd>
1206
                    <dt class="phpdocumentor-argument-list__entry">
1207
                <span class="phpdocumentor-signature__argument__name">$fullTableColumn</span>
1208
                : <span class="phpdocumentor-signature__argument__return-type">bool</span>
1209
                 = <span class="phpdocumentor-signature__argument__default-value">false</span>            </dt>
1210
            <dd class="phpdocumentor-argument-list__definition">
1211
                    <section class="phpdocumentor-description"><p>If set to true, will return table.column format</p>
1212
</section>
1213
 
1214
            </dd>
1215
            </dl>
1216
 
1217
 
1218
 
1219
        <h5 class="phpdocumentor-return-value__heading">Return values</h5>
1220
    <span class="phpdocumentor-signature__response_type">string</span>
1221
            &mdash;
1222
            <section class="phpdocumentor-description"><p>The actual name of the dbColumn in the table</p>
1223
</section>
1224
 
1225
 
1226
</article>
1227
            </section>
1228
 
1229
 
1230
    <script type="text/javascript">
1231
        function loadExternalCodeSnippets(line) {
1232
            Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
1233
                var src = pre.getAttribute('data-src').replace( /\\/g, '/');
1234
                var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
1235
                var language = 'php';
1236
 
1237
                var code = document.createElement('code');
1238
                code.className = 'language-' + language;
1239
 
1240
                pre.textContent = '';
1241
 
1242
                pre.setAttribute('data-line', line)
1243
                code.textContent = 'Loading…';
1244
 
1245
                pre.appendChild(code);
1246
 
1247
                var xhr = new XMLHttpRequest();
1248
 
1249
                xhr.open('GET', src, true);
1250
 
1251
                xhr.onreadystatechange = function () {
1252
                    if (xhr.readyState == 4) {
1253
 
1254
                        if (xhr.status < 400 && xhr.responseText) {
1255
                            code.textContent = xhr.responseText;
1256
 
1257
                            Prism.highlightElement(code);
1258
                        }
1259
                        else if (xhr.status >= 400) {
1260
                            code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
1261
                        }
1262
                        else {
1263
                            code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
1264
                        }
1265
                    }
1266
                };
1267
 
1268
                xhr.send(null);
1269
            });
1270
        }
1271
 
1272
        var modals = document.querySelectorAll("[data-modal]");
1273
 
1274
        modals.forEach(function (trigger) {
1275
            trigger.addEventListener("click", function (event) {
1276
                //event.preventDefault();
1277
                const modal = document.getElementById(trigger.dataset.modal);
1278
                modal.classList.add("phpdocumentor-modal__open");
1279
                loadExternalCodeSnippets(trigger.dataset.line)
1280
                const exits = modal.querySelectorAll("[data-exit-button]");
1281
                exits.forEach(function (exit) {
1282
                    exit.addEventListener("click", function (event) {
1283
                        event.preventDefault();
1284
                        modal.classList.remove("phpdocumentor-modal__open");
1285
                    });
1286
                });
1287
            });
1288
        });
1289
    </script>
1290
 
1291
    </article>
1292
                <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
1293
    <section class="phpdocumentor-search-results__dialog">
1294
        <header class="phpdocumentor-search-results__header">
1295
            <h2 class="phpdocumentor-search-results__title">Search results</h2>
1296
            <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
1297
        </header>
1298
        <section class="phpdocumentor-search-results__body">
1299
            <ul class="phpdocumentor-search-results__entries"></ul>
1300
        </section>
1301
    </section>
1302
</section>
1303
            </div>
1304
        </div>
1305
        <a href="classes/usersDataSourceMySQLi.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
1306
 
1307
    </main>
1308
 
1309
    <script>
1310
        cssVars({});
1311
    </script>
1312
    <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
1313
    <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
1314
    <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
1315
    <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
1316
</body>
1317
</html>