Created new method getQueryBuilderForAction from repeated code

I extracted the repeated code in a method. This also helps IDE completion since the phpdoc returns a querybuilder there. 

I made this function public because there are other querybuilder methods that are public in that class. But maybe it should be protected. I personally don't like public methods who are not in the interface.