diff options
| author | lsces <lester@lsces.co.uk> | 2026-03-02 18:24:25 +0000 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2026-03-02 18:24:25 +0000 |
| commit | bbbd60f1f590cab19bbbee7198059e0bba9acbb4 (patch) | |
| tree | 45ee7b803c31edd8bbb73bcec71805bf88192cfc | |
| parent | 6d7ddf7b3f960de8109440524ee6bb64d81f9de2 (diff) | |
| download | illuminate-firebird-bbbd60f1f590cab19bbbee7198059e0bba9acbb4.tar.gz illuminate-firebird-bbbd60f1f590cab19bbbee7198059e0bba9acbb4.tar.bz2 illuminate-firebird-bbbd60f1f590cab19bbbee7198059e0bba9acbb4.zip | |
A little bit of hacking of the delete functions but these really need a more generic solution. The hack is to get various joins working for webtrees but it would be more flexible if I could rework the joins to allow where not exists() to work.v1.1.0
| -rwxr-xr-x | src/Query/Grammars/FirebirdGrammar.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Query/Grammars/FirebirdGrammar.php b/src/Query/Grammars/FirebirdGrammar.php index 50cf731..0cde76f 100755 --- a/src/Query/Grammars/FirebirdGrammar.php +++ b/src/Query/Grammars/FirebirdGrammar.php @@ -86,7 +86,7 @@ class FirebirdGrammar extends Grammar */ public function compileDelete(Builder $query) { - if (isset($query->joins) || isset($query->limit)) { + if (isset($query->joins) ) { // || isset($query->limit)) { return $this->compileDeleteWithJoinsOrLimit($query); } @@ -102,12 +102,15 @@ class FirebirdGrammar extends Grammar protected function compileDeleteWithJoinsOrLimit(Builder $query) { $table = $this->wrapTable($query->from); - $alias = last(preg_split('/\s+as\s+/i', $query->from)); + switch ($alias) { + case 'block_setting' : $field = 'block_id'; break; + case 'places' : $field = 'p_id'; break; + default : $field = $alias.'_id'; + } + $selectSql = $this->compileSelect($query->select($alias.'.'.$field)); - $selectSql = $this->compileSelect($query->select($alias.'.p_id')); - - return "delete from {$table} where {$this->wrap('p_id')} in ({$selectSql})"; + return "delete from {$table} where {$this->wrap($field)} in ({$selectSql})"; } /** |
