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

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

slowhop/doctrine-behaviors
==========================

Doctrine2 behavior traits - slowhop fork

1.5.0(8y ago)010.0kMITPHPPHP ~7.0

Since Dec 5Pushed 8y agoCompare

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

READMEChangelogDependencies (6)Versions (18)Used By (0)

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

[](#doctrine2-behaviors)

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

This PHP `>=5.4` library is a collection of traits and interfaces that add behaviors to Doctrine2 entities and repositories.

It currently handles:

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

This project is looking for maintainers
---------------------------------------

[](#this-project-is-looking-for-maintainers)

We realize we don't have so much time anymore to maintain this project as it should be maintained. Therefore we are looking for maintainers. Open an issue if you want to keep working on this.

Notice:
-------

[](#notice)

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

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

[](#installation)

```
composer require knplabs/doctrine-behaviors:~1.1

```

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

[](#configuration)

By default, when integrated with Symfony, all subscribers are enabled (if you don't specify any configuration for the bundle). But you can enable behaviors you need in a whitelist manner:

```
knp_doctrine_behaviors:
    blameable:      false
    geocodable:     ~     # Here null is converted to false
    loggable:       ~
    sluggable:      true
    soft_deletable: true
    # All others behaviors are disabled
```

Subscribers
-----------

[](#subscribers)

If you use symfony2, you can easily register them in:

- *Recommended way:*

Add to AppKernel

```
class AppKernel
{
    function registerBundles()
    {
        $bundles = array(
            //...
            new Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle(),
            //...
        );

        //...

        return $bundles;
    }
}
```

- *Deprecated way:*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:

```
