リレーショナルデータベースを使用するのと同じ方法: public function getPosts() { return $this->hasMany(Posts::className(),['_id'=>'user_id']); }