/** * @return \yii\db\ActiveQuery */ public function getProductTypeRelation() { return $this->hasOne(ProductType::className(), ['id' => 'type_id']); }
/** * @return \yii\db\ActiveQuery */ public function getChildrenRelation() { return $this->hasMany(ProductType::className(), ['parent_id' => 'id']); }