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 Description
$attributes
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 Description
$attribute
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 Description
$attributesToPurge
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 © 2024 Winter CMS