Abhoryo/APYDataGridBundle — pull request #409 by eugene1g (2013-05-15 07:33:22+00:00)
Title: Making Entity::TABLE_ALIAS more flexible (fully backwards compatible)

Hi,

Currently TABLE_ALIAS is a constant and therefore cannot be updated by users. This presents a problem for those who want to expand/override the query with a default mechanism elsewhere that expects a different table alias.

My concrete example - I use the datagrid to show a list of students. These students are managed by an external repository service which overlays a complex set of criteria, joins, auth layers, and other trickery. I cannot change this repository to use a different table alias, but I can get a default querybuilder (with all tricks applied) back from it which I can use for this datagrid. So I just extract the main 'student' entity alias from the external repository, and pass it to this grid, and that way both can work with the same query base.

I kept the original constant in place and used the original alias value for backwards compatibility. I also removed the COUNT_ALIAS constant because it is not used or documented anywhere in the project, so probably is a leftover of a legacy or never-implemented feature.