PHPackages                             majkl578/nette-identity-doctrine - 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. majkl578/nette-identity-doctrine

ActiveNette-addon[Database &amp; ORM](/categories/database)

majkl578/nette-identity-doctrine
================================

Integration of entities implementing IIdentity in Nette 2

v2.2(10y ago)28119.5k↓39.3%18[4 issues](https://github.com/Majkl578/nette-identity-doctrine/issues)[1 PRs](https://github.com/Majkl578/nette-identity-doctrine/pulls)MITPHPPHP &gt;=5.3.2

Since Mar 1Pushed 9y ago5 watchersCompare

[ Source](https://github.com/Majkl578/nette-identity-doctrine)[ Packagist](https://packagist.org/packages/majkl578/nette-identity-doctrine)[ RSS](/packages/majkl578-nette-identity-doctrine/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (3)Versions (10)Used By (0)

Nette 2 &amp; Doctrine 2 entities
=================================

[](#nette-2--doctrine-2-entities)

Nette addon for using Doctrine 2 entities directly as Nette identity

Motivation
----------

[](#motivation)

If you are using Nette 2 and Doctrine 2 together, you will sooner or later want to use some of your entities also as identity, because it is practical.

Fortunately, this addon is here to help you with this task!

Requirements
------------

[](#requirements)

- PHP 5.3.2+
- Nette 2.2+
- Doctrine ORM 2.3+

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

[](#installation)

1. Install via composer:

    `composer require majkl578/nette-identity-doctrine`
2. Register extension in your configuration file in extensions section:

    ```
    extensions:
        doctrine2identity: Majkl578\NetteAddons\Doctrine2Identity\DI\IdentityExtension
    ```
3. Delete cache.

You're done. ;)

Usage
-----

[](#usage)

Imagine you have an application where you're implementing authentication. All you have is a regular entity for the user in your application. Now you want to implement the authentication itself - you need to have an identity. The only thing you have to do is to implement `Nette\Security\IIdentity` on your user entity, so you get something like this:

```
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class UserEntity implements IIdentity
{
	/** @ORM\Column(type="integer") @ORM\Id @ORM\GeneratedValue */
	private $id;

	/** @ORM\Column */
	private $name;

	... other properties, getters & setters

	/* implementation of IIdentity */
	public function getId()
	{
		return $this->id;
	}

	public function getRoles()
	{
		return array();
	}
}
```

(Notice the empty getRoles() method. That is due to the requirement of IIdentity. If you don't use authorization, unfortunately, it can't be omitted, sorry.)

That's all. Everything is automatic! And you can even use entities with composite identifiers!

Issues
------

[](#issues)

In case of any problems, just leave an issue here on GitHub (or, better, send a pull request).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~166 days

Recently: every ~201 days

Total

7

Last Release

3872d ago

Major Versions

1.2 → 2.02013-11-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/56faa1d197f67a98564f3bfb84d39aeeaaa7e1c979c804378b07aad783b13100?d=identicon)[Majkl578](/maintainers/Majkl578)

---

Top Contributors

[![Majkl578](https://avatars.githubusercontent.com/u/144181?v=4)](https://github.com/Majkl578 "Majkl578 (18 commits)")[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (5 commits)")[![fprochazka](https://avatars.githubusercontent.com/u/158625?v=4)](https://github.com/fprochazka "fprochazka (1 commits)")

---

Tags

nettesecurityAuthenticationormdoctrineidentity

### Embed Badge

![Health badge](/badges/majkl578-nette-identity-doctrine/health.svg)

```
[![Health](https://phpackages.com/badges/majkl578-nette-identity-doctrine/health.svg)](https://phpackages.com/packages/majkl578-nette-identity-doctrine)
```

###  Alternatives

[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8465.5M96](/packages/laravel-doctrine-orm)[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)[api-platform/doctrine-orm

Doctrine ORM bridge

294.4M92](/packages/api-platform-doctrine-orm)[kdyby/doctrine

Doctrine integration into Nette Framework

1091.0M86](/packages/kdyby-doctrine)[nettrine/orm

Doctrine ORM for Nette Framework

582.0M45](/packages/nettrine-orm)[nettrine/extensions-atlantic18

Doctrine2 behavioral extensions for Nette Framework

12934.1k7](/packages/nettrine-extensions-atlantic18)

PHPackages © 2026

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