PHPackages                             mediamonks/doctrine-extensions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. mediamonks/doctrine-extensions

ActiveLibrary[Database &amp; ORM](/categories/database)

mediamonks/doctrine-extensions
==============================

Doctrine2 behavioral extensions which allows to transform (encrypt, decrypt, hash) your data automatically

3.1.1(3y ago)14280.9k↑44.9%7MITPHPPHP &gt;=8.1

Since Mar 8Pushed 3y ago5 watchersCompare

[ Source](https://github.com/mediamonks/doctrine-extensions)[ Packagist](https://packagist.org/packages/mediamonks/doctrine-extensions)[ Docs](https://www.mediamonks.com/)[ RSS](/packages/mediamonks-doctrine-extensions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (14)Used By (0)

[![Build Status](https://camo.githubusercontent.com/70ba276025fb83a8fd0548a0f6207ac8acdafe2c55d6d706c2e98f275512b7b1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d656469616d6f6e6b732f646f637472696e652d657874656e73696f6e732f636f6e74696e756f75732d696e746567726174696f6e2e796d6c3f6c6162656c3d4349266c6f676f3d676974687562267374796c653d666c61742d737175617265)](https://github.com/mediamonks/doctrine-extensions/actions)[![Code Coverage](https://camo.githubusercontent.com/e7aa020a35c01dd136de4da1110bfbcc2a91dfe87072039dd277cb3b1c06fd42/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f6d656469616d6f6e6b732f646f637472696e652d657874656e73696f6e733f6c6162656c3d636f6465636f76266c6f676f3d636f6465636f76267374796c653d666c61742d737175617265)](https://codecov.io/gh/mediamonks/doctrine-extensions)[![Total Downloads](https://camo.githubusercontent.com/9d374b2c6773590d4b4f72d2e8088a343271c79b8831e04f0c30c776d11725f8/68747470733a2f2f706f7365722e707567782e6f72672f6d656469616d6f6e6b732f646f637472696e652d657874656e73696f6e732f646f776e6c6f616473)](https://packagist.org/packages/mediamonks/doctrine-extensions)[![Latest Stable Version](https://camo.githubusercontent.com/5611b31e57e26e8add1e6216577ab0b5f8e2fc83d9b7890dc8932b9d914b8b5e/68747470733a2f2f706f7365722e707567782e6f72672f6d656469616d6f6e6b732f646f637472696e652d657874656e73696f6e732f762f737461626c65)](https://packagist.org/packages/mediamonks/doctrine-extensions)[![Latest Unstable Version](https://camo.githubusercontent.com/02a07618344af4b9d8d2669aa844b4e294f7ab992a92e940f75084b95e2580a3/68747470733a2f2f706f7365722e707567782e6f72672f6d656469616d6f6e6b732f646f637472696e652d657874656e73696f6e732f762f756e737461626c65)](https://packagist.org/packages/mediamonks/doctrine-extensions)[![License](https://camo.githubusercontent.com/1c7980e055bd2167f5bf4b8df943bc900e3afd6ee8c8395f3aa61c3eddddfa15/68747470733a2f2f706f7365722e707567782e6f72672f6d656469616d6f6e6b732f646f637472696e652d657874656e73696f6e732f6c6963656e7365)](https://packagist.org/packages/mediamonks/doctrine-extensions)

MediaMonks Doctrine2 behavioral 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
-------------

[](#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
-------------------

[](#system-requirements)

You need:

- **PHP &gt;= 8.1**

To use the library.

Install
-------

[](#install)

Install this package by using Composer.

```
$ composer require mediamonks/doctrine-extensions

```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Documentation
=============

[](#documentation)

Please refer to the files in the [/doc](/doc) folder.

Credits
=======

[](#credits)

This package was inspired by/uses code from [gedmo/doctrine-extensions](https://packagist.org/packages/gedmo/doctrine-extensions).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~218 days

Recently: every ~20 days

Total

13

Last Release

1098d ago

Major Versions

1.2.1 → 2.0.02021-04-12

2.0.0 → 3.0.02022-05-24

PHP version history (5 changes)v1.0.0PHP &gt;=5.4

1.2.0PHP &gt;=5.6

2.0.0PHP &gt;=7.3

3.0.0PHP &gt;=8.0

3.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/411c94cbec325fa9a747f4677bb07355b374a0f01008e48c33f809627004fa5d?d=identicon)[mediamonks](/maintainers/mediamonks)

---

Top Contributors

[![mediamonks-robert](https://avatars.githubusercontent.com/u/7644785?v=4)](https://github.com/mediamonks-robert "mediamonks-robert (48 commits)")[![Edwin-Luijten](https://avatars.githubusercontent.com/u/1339637?v=4)](https://github.com/Edwin-Luijten "Edwin-Luijten (21 commits)")[![slootjes](https://avatars.githubusercontent.com/u/17158090?v=4)](https://github.com/slootjes "slootjes (12 commits)")[![deMenschRutger](https://avatars.githubusercontent.com/u/4863036?v=4)](https://github.com/deMenschRutger "deMenschRutger (1 commits)")[![marcobrotas](https://avatars.githubusercontent.com/u/6604014?v=4)](https://github.com/marcobrotas "marcobrotas (1 commits)")[![ThibaultPelloquin](https://avatars.githubusercontent.com/u/12727808?v=4)](https://github.com/ThibaultPelloquin "ThibaultPelloquin (1 commits)")

---

Tags

cryptodecryptdecryptiondoctrinedoctrine-extensiondoctrine-ormdoctrine2doctrineextensionsencryptencryptionsymfonydoctrineencryptdecrypthashextensionstransformcrypthmactransformableencryptablehashablecryptable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mediamonks-doctrine-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/mediamonks-doctrine-extensions/health.svg)](https://phpackages.com/packages/mediamonks-doctrine-extensions)
```

###  Alternatives

[michaeldegroot/doctrine-encrypt-bundle

Encrypted symfony entity's by verified and standardized libraries

1521.0M1](/packages/michaeldegroot-doctrine-encrypt-bundle)[ambta/doctrine-encrypt-bundle

Symfony 2 bundle which allows to encrypt data in database with some encrypt algorithm

77275.7k](/packages/ambta-doctrine-encrypt-bundle)[vmelnik/doctrine-encrypt-bundle

Symfony 2 bundle which allows to encrypt data in database with some encrypt algorithm

7277.3k1](/packages/vmelnik-doctrine-encrypt-bundle)[doctrineencryptbundle/doctrine-encrypt-bundle

Encrypted symfony entity's by verified and standardized libraries

29415.1k](/packages/doctrineencryptbundle-doctrine-encrypt-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
