https://github.com/mediamonks/doctrine-extensions
Doctrine2 behavioral extension Transformable
https://github.com/mediamonks/doctrine-extensions
crypto decrypt decryption doctrine doctrine-extension doctrine-orm doctrine2 doctrineextensions encrypt encryption symfony
Last synced: 10 months ago
JSON representation
Doctrine2 behavioral extension Transformable
- Host: GitHub
- URL: https://github.com/mediamonks/doctrine-extensions
- Owner: mediamonks
- License: mit
- Created: 2016-02-12T11:34:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-05-16T10:53:49.000Z (about 3 years ago)
- Last Synced: 2024-11-22T09:38:14.999Z (over 1 year ago)
- Topics: crypto, decrypt, decryption, doctrine, doctrine-extension, doctrine-orm, doctrine2, doctrineextensions, encrypt, encryption, symfony
- Language: PHP
- Size: 107 KB
- Stars: 14
- Watchers: 7
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/mediamonks/doctrine-extensions/actions)
[](https://codecov.io/gh/mediamonks/doctrine-extensions)
[](https://packagist.org/packages/mediamonks/doctrine-extensions)
[](https://packagist.org/packages/mediamonks/doctrine-extensions)
[](https://packagist.org/packages/mediamonks/doctrine-extensions)
[](https://packagist.org/packages/mediamonks/doctrine-extensions)
# MediaMonks Doctrine2 behavioral extensions
These extensions add more functionality to Doctrine2.
> Breaking changes!
All Zend transformers are now renamed to Laminas.
YAML support has been removed
> New features!
Attribute support
## Transformable
This extension uses transform and reverseTransform methods to convert data to and from the database. This can for example be used to encrypt a field when it's sent to the database and it will be decrypted when it is retrieved from the database.
The field's value will only be transformed when the value changed which also makes it possible to implement only a transform function for one way transformations like hashing.
Currently, these adapters are provided in order of recommendation:
- HaliteSymmetricTransformer - Encrypt/decrypts the value
- DefuseCryptoEncryptKeyTransformer - Encrypt/decrypts the value
- PhpHashTransformer - Hashes the value
- PhpHmacTransformer - Hashes the value with a key
- LaminasCryptHashTransformer - Hashes the value
- LaminasCryptHmacTransformer - Hashes the value with a key
- LaminasCryptSymmetricTransformer - Encrypts/decrypts the value using openssl (Mcrypt is deprecated), with aes as default algorithm
You can easily create your own transformers by implementing the [TransformableInterface](src/Transformable/Transformer/TransformerInterface.php)
## System Requirements
You need:
- **PHP >= 8.1**
To use the library.
## Install
Install this package by using Composer.
```
$ composer require mediamonks/doctrine-extensions
```
## Security
If you discover any security related issues, please email devmonk@mediamonks.com instead of using the issue tracker.
# Documentation
Please refer to the files in the [/doc](/doc) folder.
# Credits
This package was inspired by/uses code from [gedmo/doctrine-extensions](https://packagist.org/packages/gedmo/doctrine-extensions).
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.