ModelRefBase<T>.fromPath constructor

const ModelRefBase<T>.fromPath(
  1. String path, [
  2. ModelAdapter? adapter
])

Class for defining relationships between models.

By passing the path of the related document in path, you can have that relationship as data.

It is also possible to set a model adapter by specifying adapter.

Since it is a mutable class and has an interface to DocumentBase, it can be replaced by DocumentBase by implementing ModelRefBase and mixing in ModelRefMixin.

モデル間のリレーションを定義するためのクラス。

pathに関連するドキュメントのパスを渡すことでそのリレーションをデータとして持つことができます。

またadapterを指定してモデルアダプターを設定することが可能です。

ミュータブルクラスでかつDocumentBaseのインターフェースを備えているためModelRefBaseを実装し、ModelRefMixinをミックスインすることでDocumentBaseで置き換えることが可能です。

Implementation

const factory ModelRefBase.fromPath(String path, [ModelAdapter? adapter]) =
    ModelRefPath<T>;