You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@SamMousa commented on Oct 25, 2018, 10:12 AM UTC:
Currently yii\db\ActiveQuery operates in 2 contexts (this is documented in the PHPDoc):
Normal
Relational
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 :)
The reason for having it in one class is that you can do $query = Post::find() or $query = $post->getAuthor() and get a query which you can work with in the exact same way.
This is a violation of the SRP and I don't think there's a need for it.
for that reason it is split up into traits that handle the different responsibilities ;)
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.
@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: