Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 78 lines (59 sloc) 1.87 KB

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 

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

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

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); 

Listeners

Translatable

TranslatableListener has a complex configuration:

nettrine.extensions:
    translatable:
        translatable: cs_CZ
        default: cs_CZ
        translationFallback: off
        persistDefaultTranslation: off
        skipOnLoad: off
You can’t perform that action at this time.