Model

Base Model class for all user-defined DORM Models. This implements running value constructors and validators.

This is only checked at compile time using the this This template type, so only blocking invalid usage when calling it on an actual instance of the user-defined Model type. When casting to a base-class that uses the built-in generated ID field, it may be possible to circumvent this safety check.

Constructors

this
this()

Default constructor. Runs value constructors. (@constructValue UDAs)

Members

Functions

applyConstructValue
void applyConstructValue()

Explicitly calls value constructors. (@constructValue UDAs) This is already implicitly called by the default constructor and is probably not needed to be called manually.

applyPatch
void applyPatch(Patch patch)

Sets all fields on this (with the compile-time class as context) to the values in the given Patch struct.

runValidators
ModelFormat.Field[] runValidators()

Runs the defined @validator functions on fields, returns a list of failed fields.

Meta