Admin model class.
const admin = new Admin()admin.email = "test@example.com"admin.setPassword(1234567890) Copy
const admin = new Admin()admin.email = "test@example.com"admin.setPassword(1234567890)
Optional
GetCreated returns the model Created datetime.
GetId returns the model id.
GetUpdated returns the model Updated datetime.
HasId returns whether the model has a nonzero id.
IsNew indicates what type of db query (insert or update) should be used with the model instance.
MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true).
MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false)
PostScan implements the [dbx.PostScanner] interface.
It is executed right after the model was populated with the db row values.
RefreshCreated updates the model Created field with the current datetime.
RefreshId generates and sets a new model id.
The generated id is a cryptographically random 15 characters length string.
RefreshTokenKey generates and sets new random token key.
RefreshUpdated updates the model Updated field with the current datetime.
SetId sets the model id to the provided string value.
SetPassword sets cryptographically secure string to model.Password.
model.Password
Additionally this method also resets the LastResetSentAt and the TokenKey fields.
TableName returns the Admin model SQL table name.
ValidatePassword validates a plain password against the model's password.
Generated using TypeDoc
Admin model class.