Hierarchy

Implemented by

Methods

  • GetId returns the model id.

    Returns string

  • HasId returns whether the model has a nonzero id.

    Returns boolean

  • IsNew indicates what type of db query (insert or update) should be used with the model instance.

    Returns boolean

  • MarkAsNew marks the model as "new" (aka. enforces m.IsNew() to be true).

    Returns void

  • MarkAsNotNew marks the model as "not new" (aka. enforces m.IsNew() to be false)

    Returns void

  • PostScan implements the [dbx.PostScanner] interface.

    It is executed right after the model was populated with the db row values.

    Returns void

  • RefreshCreated updates the model Created field with the current datetime.

    Returns void

  • RefreshId generates and sets a new model id.

    The generated id is a cryptographically random 15 characters length string.

    Returns void

  • RefreshTokenKey generates and sets new random token key.

    Returns void

  • RefreshUpdated updates the model Updated field with the current datetime.

    Returns void

  • SetId sets the model id to the provided string value.

    Parameters

    • id: string

    Returns void

  • SetPassword sets cryptographically secure string to model.Password.

    Additionally this method also resets the LastResetSentAt and the TokenKey fields.

    Parameters

    • password: string

    Returns void

  • TableName returns the Admin model SQL table name.

    Returns string

  • ValidatePassword validates a plain password against the model's password.

    Parameters

    • password: string

    Returns boolean

Properties

avatar: number
created: types.DateTime
email: string
id: string
lastResetSentAt: types.DateTime
passwordHash: string
tokenKey: string
updated: types.DateTime

Generated using TypeDoc