@@ 312-316 (lines=5) @@ | ||
309 | * @return mixed Statement object or FALSE if an error occurred. |
|
310 | */ |
|
311 | private static function doQuery($query, $types = "", $params = []) { |
|
312 | if (!Tools::isInstanceOf($query, new DBPreparedQuery())) { |
|
313 | $dbQuery = new DBPreparedQuery($query, $types, $params); |
|
314 | } else { |
|
315 | $dbQuery = $query; |
|
316 | } |
|
317 | ||
318 | $stmt = self::connection()->prepare($dbQuery->query); |
|
319 | self::checkDbError(self::connection()); |
|
@@ 363-367 (lines=5) @@ | ||
360 | * -1 if the last query failed. |
|
361 | */ |
|
362 | public static function doUpdateQuery($query, $types = "", $params = []) { |
|
363 | if (!Tools::isInstanceOf($query, new DBPreparedQuery())) { |
|
364 | $dbQuery = new DBPreparedQuery($query, $types, $params); |
|
365 | } else { |
|
366 | $dbQuery = $query; |
|
367 | } |
|
368 | $stmt = self::doQuery($dbQuery); |
|
369 | ||
370 | switch ($dbQuery->getType()) { |
|
@@ 773-777 (lines=5) @@ | ||
770 | * @throws DBCoreException If no one or more than one records selected. |
|
771 | */ |
|
772 | public static function selectSingleRecord($query, $types = "", $params = []) { |
|
773 | if (!Tools::isInstanceOf($query, new DBPreparedQuery())) { |
|
774 | $dbQuery = new DBPreparedQuery($query, $types, $params); |
|
775 | } else { |
|
776 | $dbQuery = $query; |
|
777 | } |
|
778 | $stmt = $dbQuery->go(); |
|
779 | ||
780 | if ($stmt !== false) { |
|
@@ 809-813 (lines=5) @@ | ||
806 | * @throws DBCoreException If no one or more than one records selected. |
|
807 | */ |
|
808 | public static function selectSingleValue($query, $types = "", $params = []) { |
|
809 | if (!Tools::isInstanceOf($query, new DBPreparedQuery())) { |
|
810 | $dbQuery = new DBPreparedQuery($query, $types, $params); |
|
811 | } else { |
|
812 | $dbQuery = $query; |
|
813 | } |
|
814 | $stmt = $dbQuery->go(); |
|
815 | ||
816 | if ($stmt !== false) { |