PHP code example of taitava / silverstripe-encrypt-at-rest

1. Go to this page and download the library: Download taitava/silverstripe-encrypt-at-rest library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

taitava / silverstripe-encrypt-at-rest example snippets


class MyDataObject extends DataObject
{
    private static $db = array(
        'MyEncryptedField' => 'EncryptedText'
    );
    
    public function provideEncryptionKey($field_name, $field_type)
    {
        return *A custom key here*;
    }
}