DbRepository: Consider a filter column without query context as a statement column

Feels wrong..somehow, but it works.

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-29 08:02:12 +02:00
parent 2c9af2fb81
commit 5e0ae6410b
1 changed files with 6 additions and 2 deletions

View File

@ -529,7 +529,7 @@ abstract class DbRepository extends Repository implements Extensible, Updatable,
* @param string $table The table where to look for the column or alias
* @param string $name The name or alias of the column to validate
* @param RepositoryQuery $query An optional query to pass as context,
* if not given no join will be attempted
* if not given the column is considered being used for a statement filter
*
* @return string The given column's name
*
@ -537,7 +537,11 @@ abstract class DbRepository extends Repository implements Extensible, Updatable,
*/
public function requireFilterColumn($table, $name, RepositoryQuery $query = null)
{
if ($query === null || $this->validateQueryColumnAssociation($table, $name)) {
if ($query === null) {
return $this->requireStatementColumn($table, $name);
}
if ($this->validateQueryColumnAssociation($table, $name)) {
return parent::requireFilterColumn($table, $name, $query);
}