Purgeable
extends ExtensionBase
in package
Extension class Allows for "Private traits"
Table of Contents
- $extendableStaticCalledClass : string
- $extensionCallbacks : array<string|int, mixed>
- $extensionHidden : mixed
- $model : array<string|int, mixed>
- $originalPurgeableValues : array<string|int, mixed>
- __construct() : mixed
- addPurgeable() : $this
- Adds an attribute to the purgeable attributes list
- bootPurgeable() : void
- Boot the purgeable trait for a model.
- extend() : mixed
- extensionApplyInitCallbacks() : mixed
- extensionExtendCallback() : void
- Helper method for `::extend()` static method
- extensionIsHiddenField() : mixed
- extensionIsHiddenMethod() : mixed
- getCalledExtensionClass() : mixed
- getOriginalPurgeValue() : mixed
- Returns the original values of any purged attributes.
- getOriginalPurgeValues() : mixed
- Returns the original values of any purged attributes.
- getPurgeableAttributes() : mixed
- Returns a collection of fields that will be hashed.
- purgeAttributes() : array<string|int, mixed>
- Removes purged attributes from the dataset, used before saving.
- restorePurgedValues() : mixed
- Restores the original values of any purged attributes.
- extensionHideField() : mixed
- extensionHideMethod() : mixed
Properties
$extendableStaticCalledClass
public
static string
$extendableStaticCalledClass
= null
The calling class when using a static method.
$extensionCallbacks
protected
static array<string|int, mixed>
$extensionCallbacks
= []
Used to extend the constructor of an extension class. Eg:
BehaviorClass::extend(function($obj) { })
$extensionHidden
protected
mixed
$extensionHidden
= ['fields' => [], 'methods' => ['extensionIsHiddenField', 'extensionIsHiddenMethod']]
$model
protected
array<string|int, mixed>
$model
List of attribute names which should not be saved to the database.
public $purgeable = [];
$originalPurgeableValues
protected
array<string|int, mixed>
$originalPurgeableValues
= []
List of original attribute values before they were purged.
Methods
__construct()
public
__construct(mixed $parent) : mixed
Parameters
- $parent : mixed
Return values
mixed —addPurgeable()
Adds an attribute to the purgeable attributes list
public
addPurgeable([array<string|int, mixed>|string|null $attributes = null ]) : $this
Parameters
- $attributes : array<string|int, mixed>|string|null = null
Return values
$this —bootPurgeable()
Boot the purgeable trait for a model.
public
bootPurgeable() : void
Return values
void —extend()
public
static extend(callable $callback) : mixed
Parameters
- $callback : callable
Return values
mixed —extensionApplyInitCallbacks()
public
extensionApplyInitCallbacks() : mixed
Return values
mixed —extensionExtendCallback()
Helper method for `::extend()` static method
public
static extensionExtendCallback(callable $callback) : void
Parameters
- $callback : callable
Return values
void —extensionIsHiddenField()
public
extensionIsHiddenField(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —extensionIsHiddenMethod()
public
extensionIsHiddenMethod(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —getCalledExtensionClass()
public
static getCalledExtensionClass() : mixed
Return values
mixed —getOriginalPurgeValue()
Returns the original values of any purged attributes.
public
getOriginalPurgeValue(mixed $attribute) : mixed
Parameters
- $attribute : mixed
Return values
mixed —getOriginalPurgeValues()
Returns the original values of any purged attributes.
public
getOriginalPurgeValues() : mixed
Return values
mixed —getPurgeableAttributes()
Returns a collection of fields that will be hashed.
public
getPurgeableAttributes() : mixed
Return values
mixed —purgeAttributes()
Removes purged attributes from the dataset, used before saving.
public
purgeAttributes([mixed $attributesToPurge = null ]) : array<string|int, mixed>
Parameters
- $attributesToPurge : mixed = null
Return values
array<string|int, mixed> —Current attribute set
restorePurgedValues()
Restores the original values of any purged attributes.
public
restorePurgedValues() : mixed
Return values
mixed —extensionHideField()
protected
extensionHideField(mixed $name) : mixed
Parameters
- $name : mixed
Return values
mixed —extensionHideMethod()
protected
extensionHideMethod(mixed $name) : mixed
Parameters
- $name : mixed