trait Purgeable

Purgeable model trait

Usage: * In the model class definition:

use \Igniter\Flame\Database\Traits\Purgeable;

You must set attribute names which should not be saved to the database:

protected $purgeable = ['password'];

Properties

protected array $originalPurgeableValues

Methods

static void
bootPurgeable()

Boot the purgeable trait for a model.

$this
addPurgeable(array|string|null $attributes = null)

Adds an attribute to the purgeable attributes list

array
purgeAttributes(null $attributesToPurge = null)

Removes purged attributes, used before saving.

getPurgeableAttributes()

Returns a collection of fields to be hashed.

getOriginalPurgeValues()

Returns the original values.

null
getOriginalPurgeValue($attribute)

Returns the original value of a single attribute.

restorePurgedValues()

Restores the original values.

Details

at line 32
static void bootPurgeable()

Boot the purgeable trait for a model.

Return Value

void

Exceptions

Exception

at line 56
$this addPurgeable(array|string|null $attributes = null)

Adds an attribute to the purgeable attributes list

Parameters

array|string|null $attributes

Return Value

$this

at line 72
array purgeAttributes(null $attributesToPurge = null)

Removes purged attributes, used before saving.

Parameters

null $attributesToPurge

Return Value

array

Clean attributes

at line 98
getPurgeableAttributes()

Returns a collection of fields to be hashed.

at line 106
getOriginalPurgeValues()

Returns the original values.

at line 118
null getOriginalPurgeValue($attribute)

Returns the original value of a single attribute.

Parameters

$attribute

Return Value

null

at line 128
restorePurgedValues()

Restores the original values.