Answer the question
In order to leave comments, you need to log in
How to write several with in searh criteria of a model in Yii?
Good afternoon,
The main model has 3 connections. Is it correct to write
in the context of the search() method like this:
$criteria->with = ['manager'];
$criteria->with = ['customer'];
$criteria->with = ['hotel'];
Answer the question
In order to leave comments, you need to log in
In the first case, you are overwriting the property, so only the last value remains. What is the error in the second case? This is the correct code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question