K
K
Klein Maximus2016-02-08 20:49:09
Yii
Klein Maximus, 2016-02-08 20:49:09

Is it possible to use scripts in nested ActiveRecord Yii2 models?

Is it possible to somehow pass the script parameter to the nested model during the description of the relationships via hasMany() or hasOne()?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita, 2016-02-08
@bitver

If you check for the presence of an object in afterFind() and assign your own script to it (or to them in a loop), then maybe something will work out. Maybe there are other options, wrote the most obvious.

V
Vicom, 2017-06-02
@vicom

It seems to me that this is architecturally incorrect. the controller can work with arguments. well, the maximum is the domain layer, and then they must be converted into some form that is more abstract and close to the subject area. akin to what the encoder will take in the program (the Internet browser, for example) will change the color of the window, simply by receiving the next byte from the kernel socket stack, bypassing all intermediate layers, simply because he so wanted today

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question