PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 1.0.94
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v1.0.94
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
fluent-community / vendor / wpfluent / framework / src / WPFluent / Database / ConnectionInterface.php

ConnectionInterface.php in FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses 1.0.94, at vendor/wpfluent/framework/src/WPFluent/Database/ConnectionInterface.php

183 lines 4.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCommunity\Framework\Database;
4
5 use Closure;
6
7 interface ConnectionInterface
8 {
9 /**
10 * Begin a fluent query against a database table.
11 *
12 * @param \Closure|\FluentCommunity\Framework\Database\Query\Builder|string $table
13 * @param string|null $as
14 * @return \FluentCommunity\Framework\Database\Query\Builder
15 */
16 public function table($table, $as = null);
17
18 /**
19 * Get a new raw query expression.
20 *
21 * @param mixed $value
22 * @return \FluentCommunity\Framework\Database\Query\Expression
23 */
24 public function raw($value);
25
26 /**
27 * Run a select statement and return a single result.
28 *
29 * @param string $query
30 * @param array $bindings
31 * @param bool $useReadPdo
32 * @return mixed
33 */
34 public function selectOne($query, $bindings = [], $useReadPdo = true);
35
36 /**
37 * Run a select statement and return the first column of the first row.
38 *
39 * @param string $query
40 * @param array $bindings
41 * @param bool $useReadPdo
42 * @return mixed
43 *
44 * @throws \FluentCommunity\Framework\Database\MultipleColumnsSelectedException
45 */
46 public function scalar($query, $bindings = [], $useReadPdo = true);
47
48 /**
49 * Run a select statement against the database.
50 *
51 * @param string $query
52 * @param array $bindings
53 * @param bool $useReadPdo
54 * @return array
55 */
56 public function select($query, $bindings = [], $useReadPdo = true);
57
58 /**
59 * Run a select statement against the database and returns a generator.
60 *
61 * @param string $query
62 * @param array $bindings
63 * @param bool $useReadPdo
64 * @return \Generator
65 */
66 public function cursor($query, $bindings = [], $useReadPdo = true);
67
68 /**
69 * Run an insert statement against the database.
70 *
71 * @param string $query
72 * @param array $bindings
73 * @return bool
74 */
75 public function insert($query, $bindings = []);
76
77 /**
78 * Run an update statement against the database.
79 *
80 * @param string $query
81 * @param array $bindings
82 * @return int
83 */
84 public function update($query, $bindings = []);
85
86 /**
87 * Run a delete statement against the database.
88 *
89 * @param string $query
90 * @param array $bindings
91 * @return int
92 */
93 public function delete($query, $bindings = []);
94
95 /**
96 * Execute an SQL statement and return the boolean result.
97 *
98 * @param string $query
99 * @param array $bindings
100 * @return bool
101 */
102 public function statement($query, $bindings = []);
103
104 /**
105 * Run an SQL statement and get the number of rows affected.
106 *
107 * @param string $query
108 * @param array $bindings
109 * @return int
110 */
111 public function affectingStatement($query, $bindings = []);
112
113 /**
114 * Run a raw, unprepared query against the PDO connection.
115 *
116 * @param string $query
117 * @return bool
118 */
119 public function unprepared($query);
120
121 /**
122 * Prepare the query bindings for execution.
123 *
124 * @param array $bindings
125 * @return array
126 */
127 public function prepareBindings(array $bindings);
128
129 /**
130 * Execute a Closure within a transaction.
131 *
132 * @param \Closure $callback
133 * @param int $attempts
134 * @return mixed
135 *
136 * @throws \Throwable
137 */
138 public function transaction(Closure $callback, $attempts = 1);
139
140 /**
141 * Start a new database transaction.
142 *
143 * @return void
144 */
145 public function beginTransaction();
146
147 /**
148 * Commit the active database transaction.
149 *
150 * @return void
151 */
152 public function commit();
153
154 /**
155 * Rollback the active database transaction.
156 *
157 * @return void
158 */
159 public function rollBack();
160
161 /**
162 * Get the number of active transactions.
163 *
164 * @return int
165 */
166 public function transactionLevel();
167
168 /**
169 * Execute the given callback in "dry run" mode.
170 *
171 * @param \Closure $callback
172 * @return array
173 */
174 public function pretend(Closure $callback);
175
176 /**
177 * Get the name of the connected database.
178 *
179 * @return string
180 */
181 public function getDatabaseName();
182 }
183