PHPackages                             lukasz93p/doctrine-domain-id-types - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lukasz93p/doctrine-domain-id-types

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lukasz93p/doctrine-domain-id-types
==================================

Package which allows to use custom interfaces as entities ids instead of primitive types.

1.1(5y ago)0672MITPHPPHP ^7.1.3

Since Nov 4Pushed 5y agoCompare

[ Source](https://github.com/Lukasz93P/doctrine-domain-id-types)[ Packagist](https://packagist.org/packages/lukasz93p/doctrine-domain-id-types)[ RSS](/packages/lukasz93p-doctrine-domain-id-types/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (3)Used By (2)

doctrine-domain-id-types
========================

[](#doctrine-domain-id-types)

This package is based on **ramsey/uuid-doctrine**

ramsey/uuid-doctrine is a great package which provides new Doctrine column type - **uuid**

Although uuid column is very useful it's not enough explicit for Domain Driven Design.

For DDD best approach is to use ids with meaningful names ex. UserId, CustomerId, ProductId, instead of Uuid.

This package will help You create new Doctrine column types for aggregates/entities ids.

Fragment of ramsey's uuid-doctrine documentation:
-------------------------------------------------

[](#fragment-of-ramseys-uuid-doctrine-documentation)

### Examples

[](#examples)

#### Configuration

[](#configuration)

To configure Doctrine to use ramsey/uuid as a field type, you'll need to set up the following in your bootstrap:

```
\Doctrine\DBAL\Types\Type::addType('uuid', 'Ramsey\Uuid\Doctrine\UuidType');
```

In Symfony:

```
# app/config/config.yml
doctrine:
   dbal:
       types:
           uuid:  Ramsey\Uuid\Doctrine\UuidType
```

In Zend Framework:

```
