hasOne(User::className(), ['id' => 'from_uid']); } public function getTo() { return $this->hasOne(User::className(), ['id' => 'to_uid']); } }