@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | public function __construct($dbPath) |
| 51 | 51 | { |
| 52 | 52 | if (!file_exists($dbPath) || !is_readable($dbPath)) { |
| 53 | - throw new \Exception("Database with path '" . $dbPath ."' doesn't exist or isn't readable!"); |
|
| 53 | + throw new \Exception("Database with path '".$dbPath."' doesn't exist or isn't readable!"); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $this->_conn = new \PDO('sqlite:' . $dbPath); |
|
| 56 | + $this->_conn = new \PDO('sqlite:'.$dbPath); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | return false; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | - $q = "UPDATE `" . $thisTable . "` SET rating=? WHERE id=?"; |
|
| 277 | + $q = "UPDATE `".$thisTable."` SET rating=? WHERE id=?"; |
|
| 278 | 278 | |
| 279 | 279 | $res = $this->_conn->prepare($q); |
| 280 | 280 | $ret = $res->execute(array( |
@@ -315,10 +315,10 @@ discard block |
||
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | if (!is_null($objectId)) { |
| 318 | - $query = 'SELECT * FROM `' . $tableName . '` WHERE id=?'; |
|
| 318 | + $query = 'SELECT * FROM `'.$tableName.'` WHERE id=?'; |
|
| 319 | 319 | $params = [$objectId]; |
| 320 | 320 | } else { |
| 321 | - $query = 'SELECT * FROM ' . $tableName; |
|
| 321 | + $query = 'SELECT * FROM '.$tableName; |
|
| 322 | 322 | $params = []; |
| 323 | 323 | } |
| 324 | 324 | |
@@ -553,13 +553,13 @@ discard block |
||
| 553 | 553 | if ($field != null && $field != null) { |
| 554 | 554 | $q = " |
| 555 | 555 | SELECT id, 'video' as type FROM VideoTable |
| 556 | - WHERE `" . $field . "` LIKE ? |
|
| 556 | + WHERE `" . $field."` LIKE ? |
|
| 557 | 557 | UNION ALL |
| 558 | 558 | SELECT id, 'photo' FROM PhotoTable |
| 559 | - WHERE `" . $field . "` LIKE ?"; |
|
| 559 | + WHERE `" . $field."` LIKE ?"; |
|
| 560 | 560 | |
| 561 | 561 | $res = $this->_conn->prepare($q); |
| 562 | - $res->execute(['%' . $value . '%', '%' . $value . '%']); |
|
| 562 | + $res->execute(['%'.$value.'%', '%'.$value.'%']); |
|
| 563 | 563 | } else { |
| 564 | 564 | $q = " |
| 565 | 565 | SELECT id, 'video' as type FROM VideoTable |