trait FieldEncyptCacheTrait in Field Encryption 7
Class FieldEncyptCacheTrait.
Hierarchy
- trait \FieldEncyptCacheTrait
File
- ./
field_encrypt.cache.inc, line 11 - Field encryption cache classes.
View source
trait FieldEncyptCacheTrait {
/**
* Encrypts the data for the Cache backend.
*
* @param mixed $data
* Decrypted data.
*
* @return string
* Encrypted data string.
*/
private function encrypt($data) {
if (!is_string($data)) {
$data = serialize($data);
}
// Encrypt the data just before it's saved.
module_load_include('inc', 'field_encrypt');
return field_encrypt_encrypt($data);
}
/**
* Decrypts the data from the Cache backend.
*
* @param string $data
* Encrypted data string.
*
* @return mixed|string
* Decrypted data.
*/
private function decrypt($data) {
module_load_include('inc', 'field_encrypt');
return field_encrypt_decrypt($data);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldEncyptCacheTrait:: |
private | function | Decrypts the data from the Cache backend. | |
FieldEncyptCacheTrait:: |
private | function | Encrypts the data for the Cache backend. |