/** * @return \yii\db\ActiveQuery */ public function getUserFlags() { return $this->hasMany(UserFlag::className(), ['from_id' => 'id']); }