/** * */ public function init() { parent::init(); if ($this->modelClass === null) { $this->modelClass = Category::className(); } }
/** * @return \yii\db\ActiveQuery */ public function getCategory() { return $this->hasOne(Category::className(), ['id' => 'child_id']); }