PHPackages                             balicekt/doctrine-behaviors - 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. balicekt/doctrine-behaviors

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

balicekt/doctrine-behaviors
===========================

Integration of KnpLabs/DoctrineBehaviors to Nette\\DI

5.0.0(7y ago)116MITPHPPHP &gt;=7.1.0

Since Jun 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/balicekt/DoctrineBehaviors)[ Packagist](https://packagist.org/packages/balicekt/doctrine-behaviors)[ RSS](/packages/balicekt-doctrine-behaviors/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (11)Versions (40)Used By (0)

Doctrine Behaviors
==================

[](#doctrine-behaviors)

[![Build Status](https://camo.githubusercontent.com/289566be9965f4bd9897f784ff62a6db0ac0c733392ac1b340f77315666012ca/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5a656e6966792f446f637472696e654265686176696f72732e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Zenify/DoctrineBehaviors)[![Quality Score](https://camo.githubusercontent.com/5da7c58f41dbf010e98e13e2ca221dbb28b92fcbb78d7162744438d835d91511/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f5a656e6966792f446f637472696e654265686176696f72732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Zenify/DoctrineBehaviors)[![Code Coverage](https://camo.githubusercontent.com/698a4897ba9a061a5d21ebfe7e4d496f80f382ec4054a060dde83098ee3bd19e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f5a656e6966792f446f637472696e654265686176696f72732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Zenify/DoctrineBehaviors)[![Downloads total](https://camo.githubusercontent.com/2a7c9675173342a16ec605139212a696ff9ac3827d874d91413e2d7849ac908b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a656e6966792f646f637472696e652d6265686176696f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zenify/doctrine-behaviors)[![Latest stable](https://camo.githubusercontent.com/14fefa1f65c2217b656d13d176a20d37d62eb7ce46354167887083da151cfd86/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a656e6966792f646f637472696e652d6265686176696f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/zenify/doctrine-behaviors)

Port of [KnpLabs/DoctrineBehaviors](https://github.com/KnpLabs/DoctrineBehaviors) to Nette DI

Supported behaviors:

- Blameable
- Geocodable
- Loggable
- Sluggable
- SoftDeletable
- Translatable
- Timestampable
- Tree

For implementation to entities, check [tests](https://github.com/KnpLabs/DoctrineBehaviors/tree/master/tests/fixtures/BehaviorFixtures/ORM).

Install
-------

[](#install)

Via Composer:

```
$ composer require zenify/doctrine-behaviors
```

Register extensions you need in `config.neon`:

```
extensions:
	translatable: Zenify\DoctrineBehaviors\DI\TranslatableExtension
	- Zenify\DoctrineBehaviors\DI\TimestampableExtension
```

Usage
-----

[](#usage)

### Translatable

[](#translatable)

Setup your translator locale callback in `config.neon`:

```
translatable:
	currentLocaleCallable: [@Translator, getLocale]
```

Place trait to your entity:

```
class Article
{

	use Knp\DoctrineBehaviors\Model\Translatable\Translatable;
	// returns translated property for $article->getTitle() or $article->title
	use Zenify\DoctrineBehaviors\Entities\Attributes\Translatable;

}
```

And its translation entity:

```
class ArticleTranslation
{

	use Knp\DoctrineBehaviors\Model\Translatable\Translation;

	/**
	 * @ORM\Column(type="string")
	 * @var string
	 */
	public $title;

}
```

For deeper knowledge see test for:

- [TranslatableEntity](https://github.com/KnpLabs/DoctrineBehaviors/blob/master/tests/fixtures/BehaviorFixtures/ORM/TranslatableEntity.php)
- [TranslatableEntityTranslation](https://github.com/KnpLabs/DoctrineBehaviors/blob/master/tests/fixtures/BehaviorFixtures/ORM/TranslatableEntityTranslation.php)
- [theirs use](https://github.com/KnpLabs/DoctrineBehaviors/blob/master/tests/Knp/DoctrineBehaviors/ORM/TranslatableTest.php)

### Timestampable

[](#timestampable)

Place trait to your entity to ad `$createdAt` and `$updatedAt` properties:

```
class Article
{

	use Knp\DoctrineBehaviors\Model\Timestampable\Timestampable;

}
```

Testing
-------

[](#testing)

```
composer check-cs
vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Rules are simple:

- new feature needs tests
- all tests must pass
- 1 feature per PR

We would be happy to merge your feature then!

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~190 days

Total

35

Last Release

2659d ago

Major Versions

v1.2.2 → v2.0.02014-12-09

v2.6.0 → v4.22016-12-28

v4.2.2 → 5.0.02019-01-30

PHP version history (5 changes)v1.0.0PHP &gt;=5.4

v2.0.0PHP &gt;=5.5

v2.2.0PHP &gt;=5.6

v2.6.0PHP ^7.0

5.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4100fc9cf1a7ddc116bdeb96ccb4c6b48348d7e4f1979be4668eb1b02655d4f9?d=identicon)[balicekt](/maintainers/balicekt)

---

Top Contributors

[![martinknor](https://avatars.githubusercontent.com/u/2004222?v=4)](https://github.com/martinknor "martinknor (5 commits)")[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (4 commits)")[![balicekt](https://avatars.githubusercontent.com/u/6289261?v=4)](https://github.com/balicekt "balicekt (2 commits)")[![petrofcz](https://avatars.githubusercontent.com/u/3965506?v=4)](https://github.com/petrofcz "petrofcz (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/balicekt-doctrine-behaviors/health.svg)

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

###  Alternatives

[kdyby/doctrine

Doctrine integration into Nette Framework

1091.0M86](/packages/kdyby-doctrine)[rixxi/gedmo

Gedmo Doctrine Extensions integration into Nette Framework using Kdyby/Doctrine

1368.2k1](/packages/rixxi-gedmo)

PHPackages © 2026

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