Closed angelcoding closed 9 years ago
Its absoluttely neccesary. Moreover its normal to have Query model if you want scopes feature for example. Also look query leaves()
and roots()
usage documentation. Its work like Category::find()->roots()
or Category::find()->leaves()
while ActiveRecord behavior need instance. We do not have instance in such cases.
Aaah OK, thanks for clearing that up. I can see the advantage now when using static class methods.
I'm just wondering why a separate Query behavior is needed when you could simply add those functions to the main AR behavior and just use that without having to extend ActiveQuery and add a second behavior? e.g move roots function to NestedSetsBehavior (would be similar for leaves() function too) ...
Am I wrong in thinking this?