PHPackages                             spotlab/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. [Localization &amp; i18n](/categories/localization)
4. /
5. spotlab/doctrine-extensions

ActiveLibrary[Localization &amp; i18n](/categories/localization)

spotlab/doctrine-extensions
===========================

Doctrine2 behavioral extensions

v1.0.8(6y ago)340.9k1MITPHPPHP &gt;=5.3.2

Since Feb 16Pushed 5y ago4 watchersCompare

[ Source](https://github.com/spotlab/doctrine-extensions)[ Packagist](https://packagist.org/packages/spotlab/doctrine-extensions)[ Docs](https://github.com/spotlab/doctrine-extensions)[ RSS](/packages/spotlab-doctrine-extensions/feed)WikiDiscussions master Synced 4w ago

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

Several Doctrine extensions
===========================

[](#several-doctrine-extensions)

**Version 1.0.0**

- Nationalities available for "en" and "fr" locales

Extensions and Documentation
----------------------------

[](#extensions-and-documentation)

This package contains extensions that offer new functionalities. List of extensions:

- **Nationality** - this extension allows to create a new "Nationality" field. It gives access to a new assert and form field type. It uses the Intl locale and save data as indexes in the same format.

Installation
------------

[](#installation)

### Download with composer

[](#download-with-composer)

```
composer require spotlab/doctrine-extensions

```

Usage
-----

[](#usage)

### Ex. Nationality Form Type Integration

[](#ex-nationality-form-type-integration)

In your form:

```
public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder->add('nationality', NationalityType::class, array(
                'label' => 'user.label.nationality',
                'required' => true,
            ))
            // ...

```

### Ex. Nationality Validator config

[](#ex-nationality-validator-config)

Add in your services.yml:

```
spotlab.validator.Nationality:
    class: Spotlab\Validator\Constraints\NationalityValidator
    tags:
        - { name: validator.constraint_validator, alias: NationalityValidator }

```

### Ex. Nationality Assert usage

[](#ex-nationality-assert-usage)

In your entity:

```
/**
 * @ORM\Column(type="string", length=2)
 * @SpotlabAssert\Nationality()
 */
protected $nationality;

```

License
-------

[](#license)

This code is under MIT license.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~119 days

Recently: every ~237 days

Total

9

Last Release

2472d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5306367?v=4)[Léo POIROUX](/maintainers/leopoiroux)[@leopoiroux](https://github.com/leopoiroux)

---

Top Contributors

[![bgambier](https://avatars.githubusercontent.com/u/11303103?v=4)](https://github.com/bgambier "bgambier (4 commits)")[![pascalbeynel](https://avatars.githubusercontent.com/u/4682440?v=4)](https://github.com/pascalbeynel "pascalbeynel (1 commits)")

---

Tags

typeintlbehaviorsextensionsdoctrine2localeformfrennationalityspotlab

### Embed Badge

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

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

###  Alternatives

[a2lix/translation-form-bundle

Translate your doctrine objects easily with some helpers

3387.1M38](/packages/a2lix-translation-form-bundle)[aplus/language

Aplus Framework Language Library

2371.7M15](/packages/aplus-language)[sylius/locale

Locale handling for PHP applications.

10549.7k25](/packages/sylius-locale)[skillshare/formatphp

Internationalize PHP apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.

8031.5k](/packages/skillshare-formatphp)[delight-im/i18n

Internationalization and localization for PHP

595.3k3](/packages/delight-im-i18n)[tigrov/yii2-country

Country data for Yii2 using Intl extension and more.

151.1k](/packages/tigrov-yii2-country)

PHPackages © 2026

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