Exemplo n.º 1
0
 /**
  * @return ActiveQuery
  */
 public function getPosts()
 {
     return $this->hasMany(PostModels::className(), ['topic_id' => 'id'])->inverseOf('user');
 }
Exemplo n.º 2
0
 /**
  * @return ActiveQuery
  */
 public function getPost()
 {
     return $this->hasone(PostModels::className(), ['id' => 'post_id']);
 }