/**
  * @return \yii\db\ActiveQuery
  */
 public function getPosts()
 {
     return $this->hasMany(Post::className(), ['status' => 'id']);
 }
Exemple #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPost()
 {
     return $this->hasOne(Post::className(), ['id' => 'post_id']);
 }