There are three tables: County (id, name), Sity (id, name, country_id), Street (id, name, sity_id)
Country Sity Steet id name id name country_id id name sity_id 1 Россия 1 Москва 1 1 Арбат 1 Question 1. How can I, turning through the
Streetmodel, get such an entry: Russia Moscow, ul. ArbatQuestion 2. How can I get all the Cities and streets of these cities using the
Countrymodel. In the Internet and in the documentation I met the following code:public function getItems() { return $this->hasMany(Item::className(),['id'=>'item_id'])->via('orderItems'); }
I don’t know if it suits me and I don’t understand how to work with him either. Explain, please.