PHP Трейт Esensi\Model\Traits\HashingModelTrait

См. также: Esensi\Model\Contracts\HashingModelInterface
Автор: Daniel LaBarge ([email protected])
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$hasher Illuminate\Contracts\Hashing\Hasher The Hasher to use for hashing.
$hashing boolean Whether the model is hashing or not.

Открытые методы

Метод Описание
addHashable ( string $attribute ) Add an attribute to the hashable array.
bootHashingModelTrait ( ) Boot the trait's observers.
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.
setHashingAttribute ( string $attribute, string $value ) Set a hashed value for a hashable attribute.

Защищенные методы

Метод Описание
setHashingAndSave ( boolean $hash ) : boolean Set hashing state and then save and then reset it.

Описание методов

addHashable() публичный Метод

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

bootHashingModelTrait() публичный статический Метод

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

checkHash() публичный Метод

Return whether a plain value matches a hashed value.
public checkHash ( string $value, string $hash ) : boolean
$value string
$hash string to compare to
Результат boolean

getHashable() публичный Метод

Get the hashable attributes.
public getHashable ( ) : array
Результат array

getHasher() публичный Метод

Set the Hasher to use for hashing.
public getHasher ( ) : Illuminate\Contracts\Hashing\Hasher
Результат Illuminate\Contracts\Hashing\Hasher

getHashing() публичный Метод

Returns whether or not the model will hash attributes before saving.
public getHashing ( ) : boolean
Результат boolean

hash() публичный Метод

Return a hashed string for the value.
public hash ( string $value ) : string
$value string
Результат string

hashAttributes() публичный Метод

Hash attributes that should be hashed.
public hashAttributes ( )

isHashable() публичный Метод

Returns whether the attribute is hashable.
public isHashable ( string $attribute ) : boolean
$attribute string name
Результат boolean

isHashed() публичный Метод

Returns whether the attribute is hashed.
public isHashed ( string $attribute ) : boolean
$attribute string name
Результат boolean

mergeHashable() публичный Метод

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

removeHashable() публичный Метод

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

saveWithHashing() публичный Метод

Save with hashing even if hashing is disabled.
public saveWithHashing ( ) : boolean
Результат boolean

saveWithoutHashing() публичный Метод

Save without hashing even if hashing is enabled.
public saveWithoutHashing ( ) : boolean
Результат boolean

setHashable() публичный Метод

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

setHasher() публичный Метод

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

setHashing() публичный Метод

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

setHashingAndSave() защищенный Метод

Set hashing state and then save and then reset it.
protected setHashingAndSave ( boolean $hash ) : boolean
$hash boolean
Результат boolean

setHashingAttribute() публичный Метод

Set a hashed value for a hashable attribute.
public setHashingAttribute ( string $attribute, string $value )
$attribute string name
$value string to hash

Описание свойств

$hasher защищенное свойство

The Hasher to use for hashing.
protected Hasher,Illuminate\Contracts\Hashing $hasher
Результат Illuminate\Contracts\Hashing\Hasher

$hashing защищенное свойство

Whether the model is hashing or not.
protected bool $hashing
Результат boolean