Class GeneralModelFilter<T, ModelType>

class: GeneralModelFilter

  • general model-filter with differential update.
  • to customize, override this class.

Type Parameters

  • T extends CoreModel<ModelType>

  • ModelType extends string

Hierarchy

Implements

Constructors

Properties

FIELDS: string[]

Methods

  • parse .meta to json

    Parameters

    • model: T

      the current model

    • Optional origin: T

      the origin model

    Returns T

  • called after saving the model.

    • parse .meta back to json object.

    Parameters

    • model: T

      the saved model

    • Optional origin: T

      the origin model.

    Returns T

  • filter for before saving.

    • make sure data conversion
    • move the unknown fields to .meta.

    Parameters

    • model: T

      the current model

    • Optional origin: T

      the origin model

    Returns T

  • called before updating the model.

    Parameters

    • model: T

      the updated model

    • Optional incrementals: T

      (optional) incremental fields.

    Returns T

  • override this onBeforeSave() in sub-class.

    Parameters

    • model: T

      the current model

    • Optional origin: T

      (optional) the origin model

    Returns T

Generated using TypeDoc