Skip to content

@nhtio/web-re-active-record/relationships

The relationships which can be defined for models

Classes

ClassDescription
BelongsToRepresents a relationship between two models where the ID of the foreign model is stored as a property of the originating model.
HasManyRepresents a one-to-many relationship between models where the ID of the originating model is stored as a property of the foreign model.
HasManyThroughRepresents a one-to-many relationship between models where the ID of the originating model is stored as a property of one or many "glue" models which connect to the foreign model.
HasOneRepresents a one-to-one relationship between two models where the ID of the originating model is stored as a property of the foreign model.
ManyToManyRepresents a many-to-many relationship between models where the IDs of both models are stored in a join table (pivot table).
MorphManyRepresents a relationship between two models where the table and primary key of the foreign model stored as a property of the originating model.
MorphOneRepresents a relationship between two models where the table and primary key of the foreign model stored as a property of the originating model.
MorphToRepresents a relationship between two models where the table of the foreign model and the ID of the foreign model is stored as a property of the originating model.

Type Aliases

Type AliasDescription
BelongsToConfigurationThe configuration for a BelongsTo relationship.
ChainableRelationshipDescribes a class which defines a relationship between models which can be used in a chain.
ChainableRelationshipConfigurationDescribes the configuration tuples for the relationship classes which can be used in a chain.
HasManyConfigurationThe configuration for a HasMany relationship.
HasManyThroughConfigurationThe configuration for a HasManyThrough relationship.
HasOneConfigurationThe configuration for a HasOne relationship.
ManyToManyConfigurationThe configuration for a ManyToMany relationship.
MorphManyConfigurationThe configuration for a MorphMany relationship.
MorphOneConfigurationThe configuration for a MorphOne relationship.
MorphToConfigurationThe configuration for a MorphTo relationship.
RelationshipDescribes a class which defines a relationship between models.
RelationshipConfigurationDescribes the configuration tuples for the relationship classes.
RelationshipCtorDescribes the constructor for a class which defines a relationship between models.