PHP Interface Esensi\Model\Contracts\HashingModelInterface

Author: Daniel LaBarge ([email protected])
Show file Open project: esensi/model Interface Usage Examples

Public Methods

Method Description
addHashable ( string $attribute ) Add an attribute to the hashable array.
checkHash ( string $value, string $hash ) : boolean Return whether a plain value matches a hashed value.
getHashable ( ) : array Get the hashable attributes.
getHasher ( ) : Illuminate\Contracts\Hashing\Hasher Set the Hasher to use for hashing.
getHashing ( ) : boolean Returns whether or not the model will hash attributes before saving.
hash ( string $value ) : string Return a hashed string for the value.
hashAttributes ( ) Hash attributes that should be hashed.
isHashable ( string $attribute ) : boolean Returns whether the attribute is hashable.
isHashed ( string $attribute ) : boolean Returns whether the attribute is hashed.
mergeHashable ( array $attributes ) Merge an array of attributes with the hashable array.
removeHashable ( string $attribute ) Remove an attribute from the hashable array.
saveWithHashing ( ) : boolean Save with hashing even if hashing is disabled.
saveWithoutHashing ( ) : boolean Save without hashing even if hashing is enabled.
setHashable ( array $attributes ) Set the hashable attributes.
setHasher ( Illuminate\Contracts\Hashing\Hasher $hasher ) Set the Hasher to use for hashing.
setHashing ( $value ) Set whether or not the model will hash attributes before saving.

Method Details

addHashable() public method

Add an attribute to the hashable array.
public addHashable ( string $attribute )
$attribute string to purge

checkHash() public method

Return whether a plain value matches a hashed value.
public checkHash ( string $value, string $hash ) : boolean
$value string
$hash string to compare to
return boolean

getHashable() public method

Get the hashable attributes.
public getHashable ( ) : array
return array

getHasher() public method

Set the Hasher to use for hashing.
public getHasher ( ) : Illuminate\Contracts\Hashing\Hasher
return Illuminate\Contracts\Hashing\Hasher

getHashing() public method

Returns whether or not the model will hash attributes before saving.
public getHashing ( ) : boolean
return boolean

hash() public method

Return a hashed string for the value.
public hash ( string $value ) : string
$value string
return string

hashAttributes() public method

Hash attributes that should be hashed.
public hashAttributes ( )

isHashable() public method

Returns whether the attribute is hashable.
public isHashable ( string $attribute ) : boolean
$attribute string name
return boolean

isHashed() public method

Returns whether the attribute is hashed.
public isHashed ( string $attribute ) : boolean
$attribute string name
return boolean

mergeHashable() public method

Merge an array of attributes with the hashable array.
public mergeHashable ( array $attributes )
$attributes array to purge

removeHashable() public method

Remove an attribute from the hashable array.
public removeHashable ( string $attribute )
$attribute string to purge

saveWithHashing() public method

Save with hashing even if hashing is disabled.
public saveWithHashing ( ) : boolean
return boolean

saveWithoutHashing() public method

Save without hashing even if hashing is enabled.
public saveWithoutHashing ( ) : boolean
return boolean

setHashable() public method

Set the hashable attributes.
public setHashable ( array $attributes )
$attributes array to hash

setHasher() public method

Set the Hasher to use for hashing.
public setHasher ( Illuminate\Contracts\Hashing\Hasher $hasher )
$hasher Illuminate\Contracts\Hashing\Hasher

setHashing() public method

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