Latest release: v0.3

Nettrine / Extensions

Content

Minimal configuration

At first, you will needed Doctrine ORM/DBAL extension. Take a look at Nettrine/ORM and Nettrine/DBAL in this organization.

Secondly, place DoctrineExtensionsExtension in your NEON config file.

extensions:
    nettrine.extensions: Nettrine\Extensions\DI\DoctrineExtensionsExtension 
1
2

And setup listeners. By default all listeners are disabled, enable only required listeners.

nettrine.extensions: 
    loggable: off
    sluggable: off
    softDeleteable: off
    treeable: off
    blameable: off
    timestampable: off
    translatable: off
    uploadable: off
    sortable: off
    ipTraceable: off
1
2
3
4
5
6
7
8
9
10
11

For loggable, translatable and treeable you gonna needed to setup extra entity mapping.

extensions:
    orm.annotations: Nettrine\ORM\DI\OrmAnnotationsExtension

orm.annotations:
    paths:
        # your app entities
        - App/Model/Database/Entity
        # doctrine extensions entities
        - Gedmo\Loggable\Entity
        - Gedmo\Loggable\Entity
        - Gedmo\Tree\Entity
1
2
3
4
5
6
7
8
9
10
11

If you using nettrine/dbal all listeners are registered automatically, or you have to register it manually:

// Get EventManager, from DI or Entity Manager
$evm = $em->getEventManager();

// Register desired listener to event
$evm->addEventSubscriber($listener); 

1
2
3
4
5
6

Listeners

Translatable

TranslatableListener has a complex configuration:

nettrine.extensions:
    translatable:
        translatable: cs_CZ
        default: cs_CZ
        translationFallback: off
        persistDefaultTranslation: off
        skipOnLoad: off
1
2
3
4
5
6
7