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

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

uginroot/doctrine-type-set
==========================

Php doctrine type set

v2.5(6y ago)015MITPHPPHP ^7.2

Since Feb 17Pushed 6y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (13)Used By (0)

Install
=======

[](#install)

```
composer require uginroot/doctrine-type-set:^2.5
```

Using
=====

[](#using)

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

use Uginroot\PhpSet\SetAbstract;

class Role extends SetAbstract{
    public const ROLE_USER = 'user';
    public const ROLE_AUTHOR = 'author';
    public const ROLE_MODERATOR = 'moderator';
    public const ROLE_ADMIN = 'admin';
}

// Create doctrine type class
namespace App\DoctrineType;

use Uginroot\DoctrineTypeSet\SetDoctrineTypeAbstract;

class RoleDoctrineType extends SetDoctrineTypeAbstract{

    public function getClass() : string{
        return Role::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
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

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

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

    /**
     * @return Role
     */
    public  function getRole(): ?Role
    {
        return $this->role;
    }

    /**
     * @param Role $role
     * @return $this
     */
    public function setRole(Role $role):self
    {
        $this->role = $role;
        return $this;
    }

    /**
    * If user extends UserInterface
    * @return array
    */
    public function getRoles():array
    {
        $role = $this->getRole();
        return $role === null ? [] : $role->getNames();
    }
}
```

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

[](#register-doctrine-type)

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

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Recently: every ~22 days

Total

12

Last Release

2225d ago

Major Versions

v1.6 → v2.02020-02-25

PHP version history (2 changes)1.0PHP ^7.4

v2.3PHP ^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 (34 commits)")

### Embed Badge

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

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

###  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)
