LeKoala\Encrypt\HasEncryptedFields
This trait helps to override the default getField method in order to return the value of a field directly instead of the db object instance
Simply define this in your code
public function getField($field)
{
return $this->getEncryptedField($field);
}
public function setField($fieldName, $val)
{
return $this->setEncryptedField($fieldName, $val);
}
Synopsis
trait HasEncryptedFields
{
- // methods
- public static $this getByBlindIndex()
- public static array getAllByBlindIndex()
- public bool needsToRotateEncryption()
- public bool rotateEncryption()
- public EncryptedRow getEncryptedRow()
- public mixed getEncryptedField()
- public $this setEncryptedField()
- public boolean hasEncryptedField()
Hierarchy
Methods
public
- getAllByBlindIndex() — This value will return a list of records
- getByBlindIndex() — This value will return exactly one record, taking care of false positives
- getEncryptedField() — Extend getField to support retrieving encrypted value transparently
- getEncryptedRow()
- hasEncryptedField()
- needsToRotateEncryption() — Check if the record needs to be reencrypted with a new key or algo
- rotateEncryption() — Rotate encryption with current engine without using orm
- setEncryptedField() — Extend setField to support setting encrypted value transparently