summaryrefslogtreecommitdiff
path: root/app/Module/IndividualListModule.php
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2022-10-04 14:17:31 +0100
committerGreg Roach <greg@subaqua.co.uk>2022-10-04 14:17:31 +0100
commit10fc856aa190e25d705f56cb417fedd6439a0b0b (patch)
tree969d2230a2528d4615ba75292813f7e9846c0a69 /app/Module/IndividualListModule.php
parentf34c1717cc857016265e730b9b3ea288b5757b1c (diff)
downloadwebtrees-10fc856aa190e25d705f56cb417fedd6439a0b0b.tar.gz
webtrees-10fc856aa190e25d705f56cb417fedd6439a0b0b.tar.bz2
webtrees-10fc856aa190e25d705f56cb417fedd6439a0b0b.zip
Working on cross-database compatibility
Diffstat (limited to 'app/Module/IndividualListModule.php')
-rw-r--r--app/Module/IndividualListModule.php24
1 files changed, 0 insertions, 24 deletions
diff --git a/app/Module/IndividualListModule.php b/app/Module/IndividualListModule.php
index b27d09191a..e756d6bac5 100644
--- a/app/Module/IndividualListModule.php
+++ b/app/Module/IndividualListModule.php
@@ -1024,28 +1024,4 @@ class IndividualListModule extends AbstractModule implements ModuleListInterface
$query->where($field, 'LIKE', '\\' . $letter . '%');
}
}
-
- /**
- * @param string $expression
- * @param int $start
- * @param int $length
- * @param string $alias
- *
- * @return Expression
- */
- private function substringExpression(string $expression, int $start, int $length, string $alias): Expression
- {
- switch (DB::connection()->getDriverName()) {
- case 'sqlite':
- // SQLite also supports SUBSTRING() from 3.34.0 (2020-12-01)
- return new Expression('SUBSTR(' . $expression . ',' . $start . ',' . $length . ') AS ' . $alias);
-
- case 'sqlsrv':
- return new Expression('SUBSTRING(' . $expression . ',' . $start . ',' . $length . ') AS ' . $alias);
-
- default:
- // SQL-92 standard
- return new Expression('SUBSTRING(' . $expression . ' FROM ' . $start . ' FOR ' . $length . ') AS ' . $alias);
- }
- }
}