PHP Trait Esensi\Model\Traits\PurgingModelTrait

See also: Esensi\Model\Contracts\PurgingModelInterface
Author: Daniel LaBarge ([email protected])
Afficher le fichier Open project: esensi/model

Protected Properties

Свойство Type Description
$purging boolean Whether the model is purging or not.

Méthodes publiques

Méthode Description
addPurgeable ( string $attribute ) Add an attribute to the purgeable array.
bootPurgingModelTrait ( ) Boot the trait's observers.
getPurgeable ( ) : array Get the purgeable attributes.
getPurging ( ) : boolean Returns whether or not the model will purge attributes before saving.
isPurgeable ( string $attribute ) : boolean Returns whether the attribute is purgeable.
mergePurgeable ( array $attributes ) Merge an array of attributes with the purgeable array.
purgeAttributes ( ) Unset attributes that should be purged.
removePurgeable ( string $attribute ) Remove an attribute from the purgeable array.
saveWithPurging ( ) : boolean Save with purging even if purging is disabled.
saveWithoutPurging ( ) : boolean Save without purging even if purging is enabled.
setPurgeable ( array $attributes ) Set the purgeable attributes.
setPurging ( $value ) Set whether or not the model will purge attributes before saving.

Méthodes protégées

Méthode Description
setPurgingAndSave ( boolean $purge ) : boolean Set purging state and then save and then reset it.

Method Details

addPurgeable() public méthode

Add an attribute to the purgeable array.
public addPurgeable ( string $attribute )
$attribute string to purge

bootPurgingModelTrait() public static méthode

Boot the trait's observers.
public static bootPurgingModelTrait ( )

getPurgeable() public méthode

Get the purgeable attributes.
public getPurgeable ( ) : array
Résultat array

getPurging() public méthode

Returns whether or not the model will purge attributes before saving.
public getPurging ( ) : boolean
Résultat boolean

isPurgeable() public méthode

Returns whether the attribute is purgeable.
public isPurgeable ( string $attribute ) : boolean
$attribute string name
Résultat boolean

mergePurgeable() public méthode

Merge an array of attributes with the purgeable array.
public mergePurgeable ( array $attributes )
$attributes array to purge

purgeAttributes() public méthode

Unset attributes that should be purged.
public purgeAttributes ( )

removePurgeable() public méthode

Remove an attribute from the purgeable array.
public removePurgeable ( string $attribute )
$attribute string to purge

saveWithPurging() public méthode

Save with purging even if purging is disabled.
public saveWithPurging ( ) : boolean
Résultat boolean

saveWithoutPurging() public méthode

Save without purging even if purging is enabled.
public saveWithoutPurging ( ) : boolean
Résultat boolean

setPurgeable() public méthode

Set the purgeable attributes.
public setPurgeable ( array $attributes )
$attributes array to purge

setPurging() public méthode

Set whether or not the model will purge attributes before saving.
public setPurging ( $value )

setPurgingAndSave() protected méthode

Set purging state and then save and then reset it.
protected setPurgingAndSave ( boolean $purge ) : boolean
$purge boolean
Résultat boolean

Property Details

$purging protected_oe property

Whether the model is purging or not.
protected bool $purging
Résultat boolean