LeKoala\Encrypt\EncryptedNumberField
Value will be set on parent record through built in getField mechanisms for composite fields
This can be useful to store phone numbers, national numbers...
We keep two indexes:
- One with the full record
- One with the last 4 numbers (so if your phone number is +00 471 123 456, it will be searchable with 3456)
Synopsis
class EncryptedNumberField
extends EncryptedDBField
{
- // Inherited constants from EncryptedDBField
- const LARGE_INDEX_SIZE = 32;
- const SMALL_INDEX_SIZE = 16;
- const VALUE_SUFFIX = "Value";
- const INDEX_SUFFIX = "BlindIndex";
- // members
- private static array $composite_db = ;
- // methods
- public int getLastFourIndexSize()
- public string getLastFourBlindIndexField()
- public $this setLastFourBlindIndexField()
- public EncryptedField getEncryptedField()
- public void addToQuery()
- // Inherited methods from EncryptedDBField
- public int getOutputSize()
- public int getDomainSize()
- public int getIndexSize()
- public string getValueField()
- public $this setValueField()
- public string getBlindIndexField()
- public $this setBlindIndexField()
- public EncryptedField getEncryptedField()
- public void writeToManipulation()
- public void addToQuery()
- public string getSearchValue()
- public array getSearchParams()
- public DataList fetchDataList()
- public DataObject fetchRecord()
- public void setValue()
- public string Nice()
- public boolean exists()
- public boolean isChanged()
- public void saveInto()
- public FormField scaffoldFormField()
- public void __toString()
- public void scalarValueOnly()
- // Inherited methods from HasBaseEncryption
- public Exception getEncryptionException()
- public EncryptedField getEncryptedField()
- public string getDecryptedValue()
- protected void setEncryptionAad()
- protected string decryptValue()
Hierarchy
Extends
Constants
Name | Value |
---|---|
LARGE_INDEX_SIZE | 32 |
SMALL_INDEX_SIZE | 16 |
VALUE_SUFFIX | "Value" |
INDEX_SUFFIX | "BlindIndex" |
Members
Methods
public
- addToQuery()
- getEncryptedField()
- getLastFourBlindIndexField()
- getLastFourIndexSize()
- setLastFourBlindIndexField()
Inherited from LeKoala\Encrypt\EncryptedDBField
public
- Nice()
- __toString() — Returns the string value
- addToQuery()
- exists()
- fetchDataList()
- fetchRecord()
- getBlindIndexField()
- getDomainSize() — Input domain is the set of all possible distinct inputs.
- getEncryptedField()
- getIndexSize()
- getOutputSize() — Output size is the number of bits (not bytes) of a blind index.
- getSearchParams() — Return a ready to use array params for a where clause
- getSearchValue() — Return the blind index value to search in the database
- getValueField()
- isChanged() — This is called by getChangedFields() to check if a field is changed
- saveInto() — If we pass a DBField to the setField method, it will trigger this method
- scaffoldFormField()
- scalarValueOnly()
- setBlindIndexField()
- setValue()
- setValueField()
- writeToManipulation() — This is not called anymore, we rely on saveInto for now
Inherited from LeKoala\Encrypt\HasBaseEncryption
protected
- decryptValue() — Decrypt a value using underlying EncryptedField instance
- setEncryptionAad()
public
- getDecryptedValue() — Decrypt current value using underlying EncryptedField instance
- getEncryptedField()
- getEncryptionException()