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

ActiveLibrary

nitra/doctrine-behaviors
========================

Doctrine2 behavior traits

03.9k2PHP

Since May 6Pushed 13y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (2)

Doctrine2 Behaviors
===================

[](#doctrine2-behaviors)

[![Build Status](https://camo.githubusercontent.com/7f690ce5343def5f435b9eea2f4f3a7e32b7a3e881f64cf4e76fe5af287df579/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f4b6e704c6162732f446f637472696e654265686176696f72732e706e67)](http://travis-ci.org/KnpLabs/DoctrineBehaviors)

This php 5.4+ library is a collection of traits that add behaviors to Doctrine2 entites and repositories.

It currently handles:

- [tree](#tree)
- [translatable](#translatable)
- [timestampable](#timestampable)
- [softDeletable](#softDeletable)
- [blameable](#blameable)
- [loggable](#loggable)
- [geocodable](#geocodable)
- [filterable](#filterable)
- [sluggable](#sluggable)

Notice:
-------

[](#notice)

Some behaviors (translatable, timestampable, softDeletable, blameable, geocodable) need Doctrine listeners in order to work. Make sure to activate them by reading the [Listeners](#listeners) section.

Some traits are based on annotation driver.
You need to declare `use Doctrine\ORM\Mapping as ORM;` on top of your entity.

Listeners
---------

[](#listeners)

If you use symfony2, you can easilly register them by importing a service definition file:

```
    # app/config/config.yml
    imports:
        - { resource: ../../vendor/knplabs/doctrine-behaviors/config/orm-services.yml }
```

You can also register them using doctrine2 api:

```
