Skip to content

Commit

Permalink
Merge pull request #133 from pajousek/patch-1
Browse files Browse the repository at this point in the history
Fixed filtering in Doctrine over joined columns
  • Loading branch information
o5 committed May 13, 2014
2 parents bdaf215 + 1eb48d6 commit ce8bb1a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Grido/DataSources/Doctrine.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
namespace Grido\DataSources;

use Doctrine\ORM\Tools\Pagination\Paginator,
Grido\Components\Filters\Condition;
Grido\Components\Filters\Condition,
Nette\Utils\Strings;

/**
* Doctrine data source.
Expand Down Expand Up @@ -137,7 +138,7 @@ protected function makeWhere(Condition $condition, \Doctrine\ORM\QueryBuilder $q
if (!Condition::isOperator($column)) {
$columns[$key] = isset($this->filterMapping[$column])
? $this->filterMapping[$column]
: $this->qb->getRootAlias() . '.' . $column;
: Strings::contains($column, ".") ? $column : $this->qb->getRootAlias() . '.' . $column;
}
}

Expand Down

0 comments on commit ce8bb1a

Please sign in to comment.