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
ActiveQuery needs AFTER_FIND event #10427
Comments
why not just eager load those models in the dataprovider's query object? |
just In my case, eager loading can reduce SQL, but what I wanted is the SAME object of $foo. The first $foo already has various cached data, otherwise eagerly loaded ->foo is not and should do them again. Yii can assign backward relation via inversedOf method. It supports to recycle first object. But generally, this issue indicates that no one can assign model's AFTER_FIND handler dynamically in caller context. That event can be assigned only static context. One of Yii's advantage is dynamic event/behavior assigning in caller context instead of method overriding. |
related to #7268 |
and #7187 |
Won't be implemented in 2.0. |
I want to operate models just after fetching for individual queries. But sometimes ActiveQuery would be evaluated lazily.
I propose to trigger
ActiveQuery::EVENT_AFTER_FIND
event against to ActiveQuery's listener.Currently I should do:
I want to move them to search model class from view template.
The text was updated successfully, but these errors were encountered: