Skip to content

Conversation

MlleDelphine
Copy link
Contributor

To handle query from filter with necessary HAVING clause which does not accept alias

To handle query from filter with necessary HAVING clause which does not accept alias
Copy link
Collaborator

@npotier npotier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, and thank you for this PR.

Some changes need to be done in order to continue.

$columnForFilter = (!$column instanceof JoinColumn) ? $column : $columnsById[$filter->getColumnName()];

$fieldName = $this->getFieldName($columnForFilter, false);
$fieldName = $this->getFieldName($columnForFilter, false, $hasHavingClause);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you add a parameter to this function, you should change its signature wich is actually

protected function getFieldName($column, $withAlias = false)

return "$functionWithParameters as $alias";
}
// To handle query from filter with necessary HAVING clause which does not accept alias
if (!$withAlias && $hasHaving) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $hasHaving comes from nowhere.

I guess that it should be $hasHavingClause given as parameter of the function ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants