PHPackages                             uginroot/doctrine-type-enum - 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. uginroot/doctrine-type-enum

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

uginroot/doctrine-type-enum
===========================

Php doctrine type enum

v1.3(6y ago)018MITPHPPHP ^7.2

Since Mar 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/uginroot/doctrine-type-enum)[ Packagist](https://packagist.org/packages/uginroot/doctrine-type-enum)[ RSS](/packages/uginroot-doctrine-type-enum/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Install
=======

[](#install)

```
composer require uginroot/doctrine-type-enum:^1.3
```

Using
=====

[](#using)

Create doctrine type
--------------------

[](#create-doctrine-type)

```
// Create enum class
namespace App\Type;

use Uginroot\PhpEnum\EnumAbstract;

class Gender extends EnumAbstract{
    public const FEMALE = 1;
    public const MALE = 0;
}

// Create doctrine type class
namespace App\DoctrineType;

use Uginroot\DoctrineTypeEnum\EnumDoctrineTypeAbstract;

class GenderType extends EnumDoctrineTypeAbstract{
    public function getClass() : string{
        return Gender::class;
    }
}

// Add mapping data to entity
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * User
 *
 * @ORM\Table(name="user")
 * @ORM\Entity
 */
class User{

    /**
     * @var integer|null
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
    * @var Gender|null
    * @ORM\Column(name="role", type="GenderType", nullable=true)
    */
    private $gender;

    /**
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return Gender|null
     */
    public  function getGender(): ?Gender
    {
        return $this->gender;
    }

    /**
     * @param Gender $gender
     * @return $this
     */
    public function setGender(Gender $gender):self
    {
        $this->gender = $gender;
        return $this;
    }
}
```

Register doctrine type
----------------------

[](#register-doctrine-type)

```
# config/packages/doctrine.yaml
doctrine:
    dbal:
        types:
            GenderType: App\DoctrineType\GenderType
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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 ~7 days

Total

4

Last Release

2289d ago

PHP version history (2 changes)v1.0PHP ^7.4

v1.2PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2391460?v=4)[Soroka Anton](/maintainers/uginroot)[@uginroot](https://github.com/uginroot)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/uginroot-doctrine-type-enum/health.svg)

```
[![Health](https://phpackages.com/badges/uginroot-doctrine-type-enum/health.svg)](https://phpackages.com/packages/uginroot-doctrine-type-enum)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k13](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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