/** * @return \yii\db\ActiveQuery */ public function getPostType() { return $this->hasOne(PostType::className(), ['id' => 'post_type_id']); }
/** * @return \yii\db\ActiveQuery */ public function getPostTypes() { return $this->hasMany(PostType::className(), ['id' => 'post_type_id'])->viaTable('{{%post_type_taxonomy}}', ['taxonomy_id' => 'id']); }