Property | Type | Description | |
---|---|---|---|
$default | array | Default settings | |
$runtime | array | Holds activity flags for models |
Method | Description | |
---|---|---|
beforeDelete ( Model $model, boolean $cascade = true ) : boolean | Before delete callback | |
beforeFind ( Model $model, array $query ) : array | Before find callback | |
delete ( object $model, integer $id ) : boolean | Mark record as deleted | |
existsAndNotDeleted ( Model $model, $id ) : mixed | Check if a record exists for the given id | |
purgeDeleted ( object $model, mixed $expiration = '-90 days' ) : boolean | Purge table | |
purgeDeletedCount ( object $model, mixed $expiration = '-90 days' ) : integer | Returns number of outdated softdeleted records prepared for purge | |
setup ( Model $model, array $settings = [] ) | Setup callback | |
softDelete ( object $model, mixed $active ) : mixed | Enable/disable SoftDelete functionality | |
undelete ( object $model, integer $id ) : boolean | Mark record as not deleted |
Method | Description | |
---|---|---|
_normalizeFields ( object $model, array $settings = [] ) : array | Return normalized field array | |
_purgeDeletedConditions ( object $model, mixed $expiration = '-90 days' ) : array | Returns conditions for finding outdated records | |
_softDeleteAssociations ( object $model, mixed $active ) | Modifies conditions of hasOne and hasMany associations |
protected _softDeleteAssociations ( object $model, mixed $active ) | ||
$model | object | |
$active | mixed |
public beforeDelete ( Model $model, boolean $cascade = true ) : boolean | ||
$model | Model | |
$cascade | boolean | |
return | boolean |
public beforeFind ( Model $model, array $query ) : array | ||
$model | Model | |
$query | array | |
return | array |
public existsAndNotDeleted ( Model $model, $id ) : mixed | ||
$model | Model | |
return | mixed |