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

ActiveSyfony-bundle[Database &amp; ORM](/categories/database)

php-alchemist/doctrine-behaviors
================================

description

v0.3.1(3w ago)0279[1 issues](https://github.com/PHP-Alchemist/doctrineBehaviors/issues)BSD-3-ClausePHPPHP ~8.4CI failing

Since Feb 11Pushed 3w ago1 watchersCompare

[ Source](https://github.com/PHP-Alchemist/doctrineBehaviors)[ Packagist](https://packagist.org/packages/php-alchemist/doctrine-behaviors)[ RSS](/packages/php-alchemist-doctrine-behaviors/feed)WikiDiscussions master Synced 1w ago

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

DoctrineBehaviorsBundle
=======================

[](#doctrinebehaviorsbundle)

---

[![StyleCI](https://camo.githubusercontent.com/586b4ee3d9a99a55b93aa095d245adc5aeb37e5a92dc22d1d1472f1e847369d1/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3931333538303237362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/913580276?branch=master)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#)

A simplified doctrine extension to add common behaviors

Yet another fun-filled doctrine-behaviors-bundle. It isn't designed to be the end-all-be-all of DoctrineBehaviorsBundles, it's just the way we prefer it and the way that we use it. If this works for you great! We're excited you picked ours. If not, no hurt feelings.

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

[](#installation)

Prior to adding the DoctrineBehaviorsBundle, you will need to add the PHPAlchemist symfony recipes repo to your configuration. To do so, add the following to your `composer.json` file:

```
{
 //...
"extra": {
    "symfony": {
      "endpoint": [
        "https://api.github.com/repos/PHP-Alchemist/symfony-recipes/contents/index.json",
        "flex://defaults"
      ]
    }
  }
}
```

Next you can require the bundle:

```
composer require php-alchemist/doctrine-behaviors
```

Configuration
-------------

[](#configuration)

In your `config/packages` folder you should now find a `php_alchemist_doctrine_behaviors.yaml` file. The contents should resemble:

```
php_alchemist_doctrine_behaviors:
  decision_service: ~
```

If you have a custom decision service in which your Behaviors will look to decide if they should be executed, here is where you will configure that. The `decision_service` option should be filled in with class. Such as:

```
php_alchemist_doctrine_behaviors:
  decision_service: App\Service\DoctrineBehaviorDecisionService
```

This class will replace the default one provided by the bundle.

### Turning behaviors off

[](#turning-behaviors-off)

Every behavior is on by default. If you only want some of them, switch the rest off under `behaviors`:

```
php_alchemist_doctrine_behaviors:
  behaviors:
    liable: true
    timestampable: true
    soft_deleteable: false
```

A behavior switched off here is removed from the container entirely — no service, no Doctrine event listener, and no `decide()` call on flush. That makes it cheaper than a decision service that returns `false`, which still pays the lookup on every event.

The two options layer, and it is fine to use both:

Question it answersWhen it runs`behaviors`Should this listener exist at all?Compile time`decision_service`Should it act on *this* flush?Runtime, per eventEntity interfaceDoes this entity opt in?Runtime, per entitySo `behaviors` is the right place for a behavior you never want, and `decision_service` is the right place for one you want to toggle at runtime — from a feature flag, an environment, or a per-tenant setting.

The bundle's own `DecisionService` honors `behaviors` too, so the config works without writing any class. If you supply your own `decision_service`, that class owns the decision completely and is not handed the `behaviors` map — but anything switched off under `behaviors` is already gone from the container, so your class is never asked about it.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance95

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.7% 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 ~88 days

Recently: every ~128 days

Total

7

Last Release

25d ago

PHP version history (2 changes)v0.0.2PHP 8.\*

v0.0.3PHP ~8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f32ae1f0bf9491a59f474478c6344e37034667512769884f00d31c8d1568757?d=identicon)[druid628](/maintainers/druid628)

---

Top Contributors

[![druid628](https://avatars.githubusercontent.com/u/522820?v=4)](https://github.com/druid628 "druid628 (50 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.8k117.8M121](/packages/jdorn-sql-formatter)[backup-manager/backup-manager

A framework agnostic database backup manager with user-definable procedures and support for S3, Dropbox, FTP, SFTP, and more with drivers for popular frameworks.

1.7k1.6M11](/packages/backup-manager-backup-manager)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M88](/packages/propel-propel1)[insolita/yii2-migration-generator

Set of gii tools for generating files for migration by schema of table , phpdoc or table data

108508.0k5](/packages/insolita-yii2-migration-generator)[xpdo/xpdo

A PDO-based Object/Relational Bridge Library

7088.4k4](/packages/xpdo-xpdo)[voku/session2db

A PHP library acting as a wrapper for PHP's default session handling functions which stores data in a MySQL database, providing both better performance and better security and protection against session fixation and session hijacking.

2920.0k](/packages/voku-session2db)

PHPackages © 2026

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