1 | <?php |
||
19 | class Connection |
||
20 | { |
||
21 | use HasAdapterTrait; |
||
22 | |||
23 | /** |
||
24 | * The active PDO connection. |
||
25 | * |
||
26 | * @var PDO |
||
27 | */ |
||
28 | protected $pdo; |
||
29 | |||
30 | /** |
||
31 | * The name of the connected database. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $database; |
||
36 | /** |
||
37 | * The table prefix for the connection. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $tablePrefix = ''; |
||
42 | |||
43 | /** |
||
44 | * The database connection configuration options. |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $config = []; |
||
49 | |||
50 | protected $metadata; |
||
51 | |||
52 | protected $_query; |
||
53 | |||
54 | protected $_queries = []; |
||
55 | |||
56 | /** |
||
57 | * Create a new database connection instance. |
||
58 | * |
||
59 | * @param \PDO|\Closure $pdo |
||
60 | * @param string $database |
||
61 | * @param string $tablePrefix |
||
62 | * @param array $config |
||
63 | */ |
||
64 | 25 | public function __construct($pdo, $database = '', $tablePrefix = '', $config = []) |
|
82 | |||
83 | /** |
||
84 | * Connects to SQL server |
||
85 | * |
||
86 | * @param string $host |
||
87 | * @param string $user |
||
88 | * @param string $password |
||
89 | * @param string $database |
||
90 | * @param bool $newLink |
||
91 | * @return static |
||
92 | */ |
||
93 | public function connect($host, $user, $password, $database, $newLink = false) |
||
106 | |||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getDatabase() |
||
114 | |||
115 | /** |
||
116 | * @param string $database |
||
117 | */ |
||
118 | public function setDatabase($database) |
||
122 | |||
123 | /** |
||
124 | * @return MetadataManager |
||
125 | */ |
||
126 | public function getMetadata() |
||
135 | |||
136 | /** |
||
137 | * Prefixes table names |
||
138 | * |
||
139 | * @param string $table |
||
140 | * @return string |
||
141 | */ |
||
142 | public function tableName($table) |
||
146 | |||
147 | /** |
||
148 | * @return AbstractQuery|SelectQuery |
||
149 | */ |
||
150 | public function newSelect() |
||
154 | |||
155 | /** |
||
156 | * @param string $type optional |
||
157 | * @return AbstractQuery|SelectQuery|UpdateQuery|InsertQuery|DeleteQuery |
||
158 | */ |
||
159 | 13 | public function newQuery($type = "select") |
|
168 | |||
169 | /** |
||
170 | * @return InsertQuery |
||
171 | */ |
||
172 | public function newInsert() |
||
176 | |||
177 | /** |
||
178 | * @return UpdateQuery |
||
179 | */ |
||
180 | 1 | public function newUpdate() |
|
184 | |||
185 | /** |
||
186 | * @return DeleteQuery |
||
187 | */ |
||
188 | public function newDelete() |
||
192 | |||
193 | /** |
||
194 | * Executes SQL query |
||
195 | * |
||
196 | * @param mixed|AbstractQuery $query |
||
197 | * @return Result |
||
198 | */ |
||
199 | public function execute($query) |
||
211 | |||
212 | /** |
||
213 | * Gets the ID of the last inserted record |
||
214 | * @return int |
||
215 | */ |
||
216 | public function lastInsertID() |
||
220 | |||
221 | /** |
||
222 | * Gets the number of rows affected by the last operation |
||
223 | * @return int |
||
224 | */ |
||
225 | public function affectedRows() |
||
229 | |||
230 | /** |
||
231 | * Disconnects from server |
||
232 | */ |
||
233 | public function disconnect() |
||
243 | |||
244 | /** |
||
245 | * @param null|string $table |
||
246 | * @return mixed |
||
247 | */ |
||
248 | public function describeTable($table) |
||
252 | |||
253 | /** |
||
254 | * Adds backticks to input |
||
255 | * |
||
256 | * @param string $input |
||
257 | * @return string |
||
258 | */ |
||
259 | public function protect($input) |
||
263 | |||
264 | /** |
||
265 | * @return array |
||
266 | */ |
||
267 | public function getQueries() |
||
271 | } |
||
272 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..