@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | private function getConnection($query) |
| 60 | 60 | { |
| 61 | - if(function_exists('mysqli_connect')) { |
|
| 61 | + if (function_exists('mysqli_connect')) { |
|
| 62 | 62 | $config = $this->container->getParameter('shopware.db'); |
| 63 | 63 | $mysqli = new \Zend_Db_Adapter_Mysqli($config); |
| 64 | 64 | $connection = $mysqli->getConnection(); |
| 65 | - if($connection->multi_query($query)){ |
|
| 65 | + if ($connection->multi_query($query)) { |
|
| 66 | 66 | return $connection; |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function query($query) |
| 77 | 77 | { |
| 78 | 78 | $connection = $this->getConnection($query); |
| 79 | - if(get_class($connection) == 'mysqli'){ |
|
| 79 | + if (get_class($connection) == 'mysqli') { |
|
| 80 | 80 | return $connection; |
| 81 | 81 | } |
| 82 | 82 | return $connection->query($query); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getRowCount($query) |
| 90 | 90 | { |
| 91 | - if(get_class($query) == 'mysqli'){ |
|
| 91 | + if (get_class($query) == 'mysqli') { |
|
| 92 | 92 | return $query->affected_rows; |
| 93 | 93 | } |
| 94 | 94 | return $query->rowCount(); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function getColumnCount($query) |
| 102 | 102 | { |
| 103 | - if(get_class($query) == 'mysqli'){ |
|
| 103 | + if (get_class($query) == 'mysqli') { |
|
| 104 | 104 | return $query->field_count; |
| 105 | 105 | } |
| 106 | 106 | return $query->columnCount(); |
@@ -112,10 +112,10 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function fetchAll($query) |
| 114 | 114 | { |
| 115 | - if(get_class($query) == 'mysqli'){ |
|
| 115 | + if (get_class($query) == 'mysqli') { |
|
| 116 | 116 | $results = array(); |
| 117 | - if($result = $query->store_result()){ |
|
| 118 | - while($row = $result->fetch_assoc()){ |
|
| 117 | + if ($result = $query->store_result()) { |
|
| 118 | + while ($row = $result->fetch_assoc()) { |
|
| 119 | 119 | $results[] = $row; |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function nextResult($query) |
| 132 | 132 | { |
| 133 | - if(get_class($query) == 'mysqli'){ |
|
| 133 | + if (get_class($query) == 'mysqli') { |
|
| 134 | 134 | return $query->next_result(); |
| 135 | 135 | } |
| 136 | 136 | return false; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function close($query) |
| 144 | 144 | { |
| 145 | - if(get_class($query) == 'mysqli'){ |
|
| 145 | + if (get_class($query) == 'mysqli') { |
|
| 146 | 146 | return $query->close(); |
| 147 | 147 | } else { |
| 148 | 148 | $query->closeCursor(); |