SoftDeleteTrait
trait SoftDeleteTrait
Trait SoftDeleteTrait to be used in Models, requires deleted_at column in database table
Assumes presence of these members
Properties
Controller read-only | $mod | ||
array read-only | $properties | ||
string read-only | $table_name | Provides the methods: |
Methods
Makes sure the soft delete minimum keep duration is observed.
Will execute standard model delete method.
Returns how many days the soft deleted documents are kept.
No description
No description
No description
Implement to process event
Implement to process event
Recover soft deleted item
Default active scope.
Scope to return only soft deleted records.
Mark this model as deleted by setting deleted_at to current time
No description
Details
at line 34
_scopeNotDeleted(Query $query)
No description
at line 40
_scopeSoftDeleted(Query $query)
No description
at line 135
bool
canForceDelete()
Makes sure the soft delete minimum keep duration is observed.
e.g. document was deleted 30 days ago, but the keep duration was increased to 120 days.
at line 73
bool
forceDelete($force = false)
Will execute standard model delete method.
at line 124
int
getSoftDeleteKeepDays()
Returns how many days the soft deleted documents are kept.
at line 30
initSoftDeleteTrait()
No description
at line 107
bool
isSoftDeleted()
No description
at line 154
onForceDelete()
No description
at line 152
onRestore()
Implement to process event
at line 147
onSoftDelete()
Implement to process event
at line 91
restore()
Recover soft deleted item
at line 28
ModelCollection
scopeNotDeleted()
Default active scope.
at line 28
ModelCollection
scopeSoftDeleted()
Scope to return only soft deleted records.
at line 54
int|bool|null
softDelete()
Mark this model as deleted by setting deleted_at to current time
at line 46
withDeleted()
No description