Purgeable
trait Winter\Storm\Database\Traits\Purgeable
Properties
protected
$originalPurgeableValues
:
array
= []
List of original attribute values before they were purged.
Methods
public
addPurgeable (array | string | null $attributes = null
)
: $this
Adds an attribute to the purgeable attributes list
Parameters
Property | Type | Description |
---|---|---|
$attributes | array | string | null |
array | string | null
|
Returns
$this
public static bootPurgeable () : void
Boot the purgeable trait for a model.
Returns
void
public getOriginalPurgeValue ($attribute)
Returns the original values of any purged attributes.
Parameters
Property | Type | Description |
---|---|---|
$attribute | mixed |
mixed
|
Returns
mixed
public getOriginalPurgeValues ()
Returns the original values of any purged attributes.
Returns
mixed
public getPurgeableAttributes ()
Returns a collection of fields that will be hashed.
Returns
mixed
public
purgeAttributes (array | string $attributesToPurge = null
)
: array
Removes purged attributes from the dataset, used before saving.
Parameters
Property | Type | Description |
---|---|---|
$attributesToPurge | array | string |
array | string
Attribute(s) to purge, if unspecified, $purgable property is used |
Returns
array
Current attribute set
public restorePurgedValues ()
Restores the original values of any purged attributes.
Returns
mixed
Copyright © 2023 Winter CMS