# Model
# Static Properties
# softDeleteConfig
Type:
Object
The property that holds the model configuration.
See also: Available Options
# Static Methods
# softDelete
Type:
(id: string | number | Array | Function) => Promise
Soft delete a model by primary key(s), composite primary key(s), or expression function.
Returns a Promise that resolves with the soft deleted models.
See also: Deleting
# Instance Methods
# $softDelete
Type:
(hydrate?: boolean) => Promise
Soft delete the model instance. By default, this updates only the
key
andflagName
attribute values on the instance after they are persisted to the store.Passing
hydrate
astrue
will also hydrate the given instance. This is useful where there may bebeforeUpdate
/afterUpdate
hooks on the model that may mutate other values or to simply update instance with the latest data from the store. However, if the instance has any relation attributes loaded throughwith
, they will be reset during hydration.Returns a Promise that resolves with the soft deleted model.
See also: Deleting
# $restore
Type:
(hydrate?: boolean) => Promise
Restore the model instance into an active state.
Passing
hydrate
astrue
will also hydrate the given instance. See $softDelete for more info.Returns a Promise that resolves with the restored model.
See also: Restoring
# $trashed
Query →