PHP Class Esensi\Model\Observers\HashingModelObserver

See also: Esensi\Model\Traits\HashingModelTrait
Author: Daniel LaBarge ([email protected])
Show file Open project: esensi/model

Public Methods

Method Description
creating ( Esensi\Model\Contracts\HashingModelInterface $model ) Register an event listener for the creating event.
updating ( Esensi\Model\Contracts\HashingModelInterface $model ) Register an event listener for the updating event.

Protected Methods

Method Description
performHashing ( Esensi\Model\Contracts\HashingModelInterface $model, string $event ) Check if hashing is enabled and then hash the attributes that need hashing.

Method Details

creating() public method

Listener hashes the hashable attributes before save.
public creating ( Esensi\Model\Contracts\HashingModelInterface $model )
$model Esensi\Model\Contracts\HashingModelInterface

performHashing() protected method

Check if hashing is enabled and then hash the attributes that need hashing.
protected performHashing ( Esensi\Model\Contracts\HashingModelInterface $model, string $event )
$model Esensi\Model\Contracts\HashingModelInterface
$event string name

updating() public method

Listener hashes the hashable attributes before save.
public updating ( Esensi\Model\Contracts\HashingModelInterface $model )
$model Esensi\Model\Contracts\HashingModelInterface