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 150
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 86
bool
forceDelete($force = false)
Will execute standard model delete method.
at line 139
int
getSoftDeleteKeepDays()
Returns how many days the soft deleted documents are kept.
at line 33
void
initSoftDeleteTrait()
No description
at line 122
bool
isSoftDeleted()
No description
at line 169
onForceDelete()
No description
at line 167
onRestore()
Implement to process event
at line 162
onSoftDelete()
Implement to process event
at line 106
bool
restore()
Recover soft deleted item
at line 31
ModelCollection
scopeNotDeleted()
Default active scope.
at line 31
ModelCollection
scopeSoftDeleted()
Scope to return only soft deleted records.
at line 67
int|bool|null
softDelete()
Mark this model as deleted by setting deleted_at to current time
at line 59
ModelCollection
withDeleted()
No description