PHPackages                             consistence-community/consistence-doctrine-symfony - 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. consistence-community/consistence-doctrine-symfony

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

consistence-community/consistence-doctrine-symfony
==================================================

Symfony Bundle integrating Consistence library with Doctrine ORM

2.1.1(4y ago)2268.6k↓50%1MITPHPPHP ~8.0

Since Jan 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/consistence-community/consistence-doctrine-symfony)[ Packagist](https://packagist.org/packages/consistence-community/consistence-doctrine-symfony)[ RSS](/packages/consistence-community-consistence-doctrine-symfony/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (9)Used By (0)

Symfony Bundle integrating Consistence library with Doctrine ORM
================================================================

[](#symfony-bundle-integrating-consistence-library-with-doctrine-orm)

**This package is a fork of [`consistence/consistence-doctrine-symfony`](https://github.com/consistence/consistence-doctrine-symfony) maintained by community to support new PHP versions.**

---

> This is a Symfony bundle providing integration for the standalone package [`consistence-community/consistence-doctrine`](https://github.com/consistence-community/consistence-doctrine), if you are not using Symfony, follow instructions there.

This bundle provides integration of [Consistence](https://github.com/consistence-community/consistence) value objects for [Doctrine ORM](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/) so that you can use them in your entities.

For now, the only integration which is needed is for [Enums](https://github.com/consistence-community/consistence/blob/master/docs/Enum/enums.md), see the examples below.

Usage
-----

[](#usage)

[Enums](https://github.com/consistence-community/consistence/blob/master/docs/Enum/enums.md) represent predefined set of values and of course, you will want to store these values in your database as well. Since [`Enums`](https://github.com/consistence-community/consistence/blob/master/src/Enum/Enum.php) are objects and you only want to store the represented value, there has to be some mapping.

You can see it in this example where you want to store sex for your `User`s:

```
