-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDOCS.html
155 lines (155 loc) · 7.19 KB
/
DOCS.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Base Documentation</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container my-5">
<h1 class="mb-4">Base Documentation</h1>
<p><a href="README.md" class="btn btn-primary">View README</a></p>
<div class="card mt-4">
<div class="card-body">
<h5 class="card-title">Class Overview</h5>
<p></p>
</div>
</div>
<h2 class="mt-5">Methods</h2> <div class="card mt-3">
<div class="card-body">
<h5 class="card-title">__construct</h5>
<p class="card-text">/**
* Construct a new base object for a persistence driver.
*
* The type parameter should be either 'JSON' or 'PDO'. If not provided, it
* defaults to 'JSON'. The location parameter should be the path to the
* persistence location. If not provided, it defaults to 'database'.
*
* @param string $type The type of persistence driver to use.
* @param string $location The path to the persistence location.
*/</p>
<h6>Example usage:</h6>
<pre><code>$instance->__construct($type, $location);</code></pre>
</div>
</div> <div class="card mt-3">
<div class="card-body">
<h5 class="card-title">insert</h5>
<p class="card-text">/**
* Insert data into the specified table.
*
* This method delegates the insert operation to the underlying persistence
* driver, which handles the specifics of how the data is stored.
*
* @param string $table The name of the table to insert data into.
* @param array $data An associative array representing the data to be inserted
* where the keys are column names and the values are the corresponding values.
*/</p>
<h6>Example usage:</h6>
<pre><code>$instance->insert($table, $data);</code></pre>
</div>
</div> <div class="card mt-3">
<div class="card-body">
<h5 class="card-title">select</h5>
<p class="card-text">/**
* Select data from the specified table.
*
* This method delegates the select operation to the underlying persistence
* driver, which handles the specifics of how the data is retrieved.
*
* @param string $table The name of the table to select data from.
* @param array $where An associative array representing the conditions for
* which records should be returned. The keys are column
* names and the values are the corresponding values.
* @return array An array of associative arrays, where each associative array
* represents a record in the table and the keys are column names
* and the values are the corresponding values.
*/</p>
<h6>Example usage:</h6>
<pre><code>$instance->select($table, $where);</code></pre>
</div>
</div> <div class="card mt-3">
<div class="card-body">
<h5 class="card-title">upsert</h5>
<p class="card-text">/**
* Upsert data into the specified table.
*
* This method delegates the upsert operation to the underlying persistence
* driver, which handles the specifics of how the data is stored.
*
* @param string $table The name of the table to upsert data into.
* @param array $data An associative array representing the data to be upserted
* where the keys are column names and the values are the
* corresponding values.
* @param string $uniqueKey The column name to use as the unique key for the
* upsert operation.
*/</p>
<h6>Example usage:</h6>
<pre><code>$instance->upsert($table, $data, $uniqueKey);</code></pre>
</div>
</div> <div class="card mt-3">
<div class="card-body">
<h5 class="card-title">selectWithLimit</h5>
<p class="card-text">/**
* Select data from the specified table with a limit and offset.
*
* This method delegates the select with limit and offset operation to the
* underlying persistence driver, which handles the specifics of how the data
* is retrieved.
*
* @param string $table The name of the table to select data from.
* @param array $where An associative array representing the conditions for
* which records should be returned. The keys are column
* names and the values are the corresponding values.
* @param int $limit The maximum number of records to return.
* @param int $offset The number of records to skip before returning records.
* @return array An array of associative arrays, where each associative array
* represents a record in the table and the keys are column names
* and the values are the corresponding values.
*/</p>
<h6>Example usage:</h6>
<pre><code>$instance->selectWithLimit($table, $where, $limit, $offset);</code></pre>
</div>
</div> <div class="card mt-3">
<div class="card-body">
<h5 class="card-title">join</h5>
<p class="card-text">/**
* Join two tables based on a common column.
*
* This method delegates the join operation to the underlying persistence
* driver, which handles the specifics of how the data is joined.
*
* @param string $table1 The name of the first table to join.
* @param string $table2 The name of the second table to join.
* @param string $joinColumnTable1 The name of the column in the first table
* to use as the join key.
* @param string $joinColumnTable2 The name of the column in the second table
* to use as the join key.
* @return array An array of associative arrays, where each associative array
* represents a record in the joined table and the keys are
* column names and the values are the corresponding values.
*/</p>
<h6>Example usage:</h6>
<pre><code>$instance->join($table1, $table2, $joinColumnTable1, $joinColumnTable2);</code></pre>
</div>
</div> <div class="card mt-3">
<div class="card-body">
<h5 class="card-title">delete</h5>
<p class="card-text">/**
* Delete records from the specified table.
*
* This method delegates the delete operation to the underlying persistence
* driver, which handles the specifics of how the data is deleted.
*
* @param string $table The name of the table to delete records from.
* @param array $where An associative array representing the conditions for
* which records should be deleted. The keys are column
* names and the values are the corresponding values.
*/</p>
<h6>Example usage:</h6>
<pre><code>$instance->delete($table, $where);</code></pre>
</div>
</div></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>