PHPackages                             pchapl/ids - 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. pchapl/ids

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

pchapl/ids
==========

Symfony bundle for doctrine custom types autoconfiguration

2.0.0(2y ago)031WTFPLPHPPHP ^8.0.0

Since Mar 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/pchapl/ids)[ Packagist](https://packagist.org/packages/pchapl/ids)[ RSS](/packages/pchapl-ids/feed)WikiDiscussions main Synced 1w ago

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

Symfony bundle provides id type autoconfiguration for doctrine
==============================================================

[](#symfony-bundle-provides-id-type-autoconfiguration-for-doctrine)

[![github workflow status](https://camo.githubusercontent.com/4b93080ccec2aed5e37e4ee411b389731cf2fb7435341b465ecb00f14248d824/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f70636861706c2f6964732f6275696c64253230616e6425323074657374)](https://camo.githubusercontent.com/4b93080ccec2aed5e37e4ee411b389731cf2fb7435341b465ecb00f14248d824/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f70636861706c2f6964732f6275696c64253230616e6425323074657374)

[![latest tag](https://camo.githubusercontent.com/df4c7574c0ec96d2bff20ce3fcee72e817c0fd8e34cc3f5194a66b8a906f491f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f70636861706c2f696473)](https://camo.githubusercontent.com/df4c7574c0ec96d2bff20ce3fcee72e817c0fd8e34cc3f5194a66b8a906f491f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f70636861706c2f696473)

[![license](https://camo.githubusercontent.com/7ea506cde413ea951e882b11d36f152612cb847b4c96e5aaa188859c054fb57d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70636861706c2f696473)](https://camo.githubusercontent.com/7ea506cde413ea951e882b11d36f152612cb847b4c96e5aaa188859c054fb57d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70636861706c2f696473)

[![code coverage](https://camo.githubusercontent.com/67f9fa06702bfe061f1bd898ac6434453c291064c52a9e4ebbcb0687f4b4adff/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f70636861706c2f696473)](https://camo.githubusercontent.com/67f9fa06702bfe061f1bd898ac6434453c291064c52a9e4ebbcb0687f4b4adff/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f70636861706c2f696473)

Usage
-----

[](#usage)

`composer require pchapl/ids`

Enable bundle in `config/bundles.php`:

```
    PChapl\DoctrineIdBundle\DoctrineIdBundle::class => ['all' => true],
```

Create Id classes like

```
namespace App\Data;

use PChapl\DoctrineIdBundle\Id\Base;

final class AccountId extends Base
{
}
```

Configure the bundle with types in the `config/packages/doctrine_id.yaml`:

```
doctrine_id:
    types:
        account_id: App\Data\AccountId
        user_id: App\Data\UserId
```

Then just use in entities

```
#[ORM\Entity]
class Account
{
    #[ORM\Column(type="account_id")]
    private AccountId $id;

    public function __construct(AccountId $id)
    {
        $this->id = $id;
    }

    public function getId(): AccountId
    {
        return $this->id;
    }
```

There are two ways to instantiate ids: implement Factory interface for `Base::new` method or just call `Base::fromValue`with generated string id:

```
/** @var \Hidehalo\Nanoid\Client $nanoidClient */

$factory = new class($nanoidClient) implements \PChapl\DoctrineIdBundle\Id\Factory {
    public function __construct(private \Hidehalo\Nanoid\Client $nano)
    {
    }

    public function generate(): string
    {
        return $this->nano->generateId();
    }
};

$account1 = new Account(AccountId::new($factory));
$account2 = new Account(AccountId::fromValue($nanoidClient->generateId()));
$account3 = new Account(AccountId::fromValue(\Ramsey\Uuid\Uuid::uuid4()->toString()));
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~155 days

Recently: every ~232 days

Total

7

Last Release

955d ago

Major Versions

0.1.4 → 1.0.02021-09-25

1.0.0 → 2.0.02023-10-06

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11299467?v=4)[Pavel Chaplygin](/maintainers/pchapl)[@pchapl](https://github.com/pchapl)

---

Top Contributors

[![pchapl](https://avatars.githubusercontent.com/u/11299467?v=4)](https://github.com/pchapl "pchapl (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pchapl-ids/health.svg)

```
[![Health](https://phpackages.com/badges/pchapl-ids/health.svg)](https://phpackages.com/packages/pchapl-ids)
```

###  Alternatives

[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

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