Mixin that adds load() / loadOrFail() methods to an entity class. These methods ensure the entity is loaded
from the database without reloading it if it already is — unlike init(), which always refreshes.
Useful when migrating from a non-Ref-based codebase where lazy loading support is desired without the
.$ / .get() indirection that the Reference wrapper requires. Opt-in so it does not conflict with entities
that already define a load or loadOrFail property — applying the mixin to a base class that already has
either method is a compile error to prevent silent override.
Call without arguments (Loadable()) for a standalone base with no other inheritance, or pass a base class
(Loadable(BaseEntity)) to compose. The convenience alias LoadableBaseEntity is shorthand for the
latter.
Mixin that adds
load()/loadOrFail()methods to an entity class. These methods ensure the entity is loaded from the database without reloading it if it already is — unlikeinit(), which always refreshes.Useful when migrating from a non-
Ref-based codebase where lazy loading support is desired without the.$/.get()indirection that theReferencewrapper requires. Opt-in so it does not conflict with entities that already define aloadorloadOrFailproperty — applying the mixin to a base class that already has either method is a compile error to prevent silent override.Call without arguments (
Loadable()) for a standalone base with no other inheritance, or pass a base class (Loadable(BaseEntity)) to compose. The convenience alias LoadableBaseEntity is shorthand for the latter.