diff options
Diffstat (limited to 'app/Models/DatabaseDAO.php')
| -rw-r--r-- | app/Models/DatabaseDAO.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php index 05ca98355..7dbe1db3f 100644 --- a/app/Models/DatabaseDAO.php +++ b/app/Models/DatabaseDAO.php @@ -407,4 +407,17 @@ SQL; } } } + + /** + * Ensure that some PDO columns are `string` and not `bigint`. + * @param array<string|int|null> $table + * @param array<string> $columns + */ + public static function pdoString(array &$table, array $columns): void { + foreach ($columns as $column) { + if (isset($table[$column])) { + $table[$column] = (string)$table[$column]; + } + } + } } |
