CoreBOSBB

Full Version: The QueryGenerator class
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Looking at the code from this PR, I saw a class called QueryGenerator that could save me coding I think. Can anyone explain a bit about this class?
QueryGenerator class is a very powerful query abstraction capable of generating very complex SQL for any module in the system.
At a very high level it is:
- instantiate against a module
- indicate the fields you want
- indicate the conditons
- ask for the SQL

Look at the unit test for some examples:
https://github.com/tsolucio/coreBOSTests/blob/master/include/QueryGenerator/QueryGeneratorTest.php
Cool, I've skimmed through it. Seems like a wrapper for complex queries yes. Does it also take into account address tables for modules like accounts, salesorders etc.?
Cool, check out this function in my Schedular module, where I wrote a whole query function (which is not perfect yet). I think I could simplify this by using the Query Generator.
wow! definitely, this class can help there :-)

Patience, I learned about a condition class for events this past week that exists in the code for over 6 years!!
Cool, I'll wait a bit for that then.
Sorry, I didn't express myself correctly nor understood that you need help.

I meant that I found a class while I was documenting that I didn't know existed, still, after all this time. It is not related to query generator.

If you need help with QG, let me know.
No problem, I understood kind of what you meant, but thought I could use the class in my AJAX function. Anyway I'll get back here if I need help on the QG class.