Exemplo n.º 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPosts()
 {
     return $this->hasMany(YBoardPost::className(), ['user_id' => 'id']);
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getLastPost()
 {
     return $this->hasOne(YBoardPost::className(), ['id' => 'last_post_id']);
 }
Exemplo n.º 3
0
 /**
  * @return array relational rules.
  */
 public function getLastPost()
 {
     // NOTE: you may need to adjust the relation name and the related
     // class name for the relations automatically generated below.
     return $this->hasOne(YBoardPost::className(), ['id' => 'last_post_id']);
 }