Answer the question
In order to leave comments, you need to log in
How to check if a model is a single instance or a collection in yii?
Good afternoon,
How to catch the difference between the two models in the code? $model = Cars::model()->findAll();
// there can be 1 - up to infinity of entries
and $model = Cars::model()->findByPk();
This is necessary in order - to use or not use foreach in a certain place ;
Answer the question
In order to leave comments, you need to log in
is_array()
But in general, if such a problem arose, then its solution is a crutch. This should not be, these are problems in the application architecture.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question