Answer the question
In order to leave comments, you need to log in
How to add no relations in Yii?
There is a Place model, it belongs to the Metro model.
How to add the absence of the subway?
In order not to suffer too much, I decided to add id 0 name to the database. Missing, and as it turned out later, using the framework, I can’t add an entry with id 0 to the database if this entry is gone.
In some parts of the code, you have to call $model->metro->name (connection), and for many elements metro_id = 0.
How to do everything right?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question