hasOne()
* * public function getCountry() * { * return $this->hasOne(Country::className(), ['id' => 'country_id']); * } *
hasMany()
* * public function getOrders() * { * return $this->hasMany(Order::className(), ['customer_id' => 'id']); * } *
Notice the opposite order? The docs explain why but it’s still confusing.