コード例 #1
0
ファイル: Post.php プロジェクト: pramana08/app-cms
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPostType()
 {
     return $this->hasOne(PostType::className(), ['id' => 'post_type']);
 }
コード例 #2
0
ファイル: Taxonomy.php プロジェクト: ochiem/app-cms
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPostTypes()
 {
     return $this->hasMany(PostType::className(), ['id' => 'post_type_id'])->viaTable('{{%post_type_taxonomy}}', ['taxonomy_id' => 'id']);
 }