| @@ 180-186 (lines=7) @@ | ||
| 177 | $updateRow['tstamp'] = time(); |
|
| 178 | $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($this->tableName); |
|
| 179 | $types = []; |
|
| 180 | if ($connection->getDatabasePlatform() instanceof SQLServerPlatform) { |
|
| 181 | // mssql needs to set proper PARAM_LOB and others to update fields |
|
| 182 | $tableDetails = $connection->getSchemaManager()->listTableDetails($this->tableName); |
|
| 183 | foreach ($updateRow as $columnName => $columnValue) { |
|
| 184 | $types[$columnName] = $tableDetails->getColumn($columnName)->getType()->getBindingType(); |
|
| 185 | } |
|
| 186 | } |
|
| 187 | $connection->update( |
|
| 188 | $this->tableName, |
|
| 189 | $updateRow, |
|
| @@ 7065-7071 (lines=7) @@ | ||
| 7062 | ||
| 7063 | $types = []; |
|
| 7064 | $platform = $connection->getDatabasePlatform(); |
|
| 7065 | if ($platform instanceof SQLServerPlatform) { |
|
| 7066 | // mssql needs to set proper PARAM_LOB and others to update fields |
|
| 7067 | $tableDetails = $connection->getSchemaManager()->listTableDetails($table); |
|
| 7068 | foreach ($fieldArray as $columnName => $columnValue) { |
|
| 7069 | $types[$columnName] = $tableDetails->getColumn($columnName)->getType()->getBindingType(); |
|
| 7070 | } |
|
| 7071 | } |
|
| 7072 | ||
| 7073 | // Execute the UPDATE query: |
|
| 7074 | $updateErrorMessage = ''; |
|
| @@ 158-164 (lines=7) @@ | ||
| 155 | ||
| 156 | $types = []; |
|
| 157 | $platform = $connection->getDatabasePlatform(); |
|
| 158 | if ($platform instanceof SQLServerPlatform) { |
|
| 159 | // mssql needs to set proper PARAM_LOB and others to update fields |
|
| 160 | $tableDetails = $connection->getSchemaManager()->listTableDetails($tableName); |
|
| 161 | foreach ($fieldValues as $columnName => $columnValue) { |
|
| 162 | $types[$columnName] = $tableDetails->getColumn($columnName)->getType()->getBindingType(); |
|
| 163 | } |
|
| 164 | } |
|
| 165 | ||
| 166 | $connection->insert($tableName, $fieldValues, $types); |
|
| 167 | } catch (DBALException $e) { |
|
| @@ 204-210 (lines=7) @@ | ||
| 201 | ||
| 202 | $types = []; |
|
| 203 | $platform = $connection->getDatabasePlatform(); |
|
| 204 | if ($platform instanceof SQLServerPlatform) { |
|
| 205 | // mssql needs to set proper PARAM_LOB and others to update fields |
|
| 206 | $tableDetails = $connection->getSchemaManager()->listTableDetails($tableName); |
|
| 207 | foreach ($fieldValues as $columnName => $columnValue) { |
|
| 208 | $types[$columnName] = $tableDetails->getColumn($columnName)->getType()->getBindingType(); |
|
| 209 | } |
|
| 210 | } |
|
| 211 | ||
| 212 | $connection->update($tableName, $fieldValues, ['uid' => $uid], $types); |
|
| 213 | } catch (DBALException $e) { |
|