Presenter Output

This section will show you how to use the decorated value provided by the \Anomaly\EncryptedFieldType\EncryptedFieldTypePresenter class.

EncryptedFieldTypePresenter::decrypt()

The decrypt method decrypts the value.

Returns: string
Example
$decorated->example->decrypt();
Twig
{{ decorated.example.decrypt() }}

EncryptedFieldTypePresenter::hash()

The hash method returns a hash of the decrypted value. This is nice for comparing encrypted values without exposing them.

Returns: string
Arguments
Key Required Type Default Description
$algorithm false string md5 The hashing algorithm to use. Valid options vary by machine.
Example
$decorated->example->hash('sha256');
Twig
{{ decorated.example.hash('sha256') }}

EncryptedFieldTypePresenter::md5()

The md5 method maps to hash('md5').

Returns: string
Example
$decorated->example->md5();
Twig
{{ decorated.example.md5() }}

EncryptedFieldTypePresenter::sha1()

The sha1 method maps to hash('sha1').

Returns: string
Example
$decorated->example->sha1();
Twig
{{ decorated.example.sha1() }}

EncryptedFieldTypePresenter::sha265()

The sha256 method maps to hash('sha256').

Returns: string
Example
$decorated->example->sha256();
Twig
{{ decorated.example.sha256() }}

EncryptedFieldTypePresenter::__value()

The __value method is used in various areas of the system and maps to decrypt.

Arguments
Key Required Type Default Description
$collection true string none The collection to add the asset to.