-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split ActiveQuery #2
Comments
The reason for having it in one class is that you can do
for that reason it is split up into traits that handle the different responsibilities ;) |
It doesn't have to be the same class to do that though. |
how else provide the same functionality? If I extend ActiveQuery with a custom query class, I want the same functionality to be provided regardless of whether I get the query from find() or relation. |
Ah, didn't think a about extending, let me give it some more thought |
@SamMousa commented on Oct 25, 2018, 10:12 AM UTC:
Currently
yii\db\ActiveQuery
operates in 2 contexts (this is documented in the PHPDoc):This is a violation of the SRP and I don't think there's a need for it.
For example,
ActiveQuery
class has a$primaryModel
property, and a lot of functions change their behavior based on whether or not it is set.I think we should split this class up into 2 classes, I realize there's some stuff to figure out, that's what this issue is for :)
This issue was moved by samdark from yiisoft/yii-core#53.
The text was updated successfully, but these errors were encountered: