/** * @return \yii\db\ActiveQuery */ public function getType() { return $this->hasOne(Type::className(), ['id' => 'type_id']); }
/** * @return \yii\db\ActiveQuery */ public function getTypes() { return $this->hasMany(Type::className(), ['category_id' => 'id']); }