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 5d 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 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

2242d ago

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

v1.2PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c76c2491b71e1ee1d93f2dbaa614c09360ea520872f4522211805df136e3306b?d=identicon)[uginroot](/maintainers/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

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[pixelfederation/doctrine-resettable-em-bundle

Symfony bundle for decorating default entity managers using a resettable decorator.

20113.5k](/packages/pixelfederation-doctrine-resettable-em-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.

1022.4k](/packages/rcsofttech-audit-trail-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

813.1k](/packages/ahmed-bhs-doctrine-doctor)

PHPackages © 2026

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