Skip to content

Commit

Permalink
Merge pull request #17 from ukfast/relationship-bug
Browse files Browse the repository at this point in the history
Relationship mapping now correctly identifies relationship vs column
  • Loading branch information
Gman98ish authored Mar 23, 2022
2 parents 6a44871 + d4301b8 commit 1635e5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MapFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ public function wrap(ModifiesQueries $filter)
public function modifyQuery($query, SearchTerm $search)
{
if (strpos($this->column, '.') !== false) {
[$relationship, $relCol] = explode(".", $this->column);
$parts = explode(".", $this->column);
$relCol = array_pop($parts);
$relationship = implode(".", $parts);

$relSearch = new SearchTerm(
$search->property(),
$search->operator(),
Expand Down

0 comments on commit 1635e5b

Please sign in to comment.