public function getCategory() { return $this->hasOne(PostCategory::className(), ['id' => 'cate_id']); }
/** * @return \yii\db\ActiveQuery */ public function getPostCategories() { return $this->hasMany(PostCategory::className(), ['category_id' => 'id']); }