# Nettrine Extensions Atlantic18

Doctrine (Atlantic18/DoctrineExtensions) extension for Nette Framework

# Content

# Setup

First of all, install and configure Nettrine DBAL and Nettrine ORM packages`.

Install package

composer require nettrine/extensions-atlantic18
1

Register extension

extensions:
    nettrine.extensions.atlantic18: Nettrine\Extensions\Atlantic18\DI\Atlantic18BehaviorExtension
1
2

# Configuration

Configure listeners. By default all listeners are disabled, enable only required listeners.

nettrine.extensions.atlantic18:
    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

# Loggable, Translatable, Treeable

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

# Translatable

TranslatableListener has a complex configuration:

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

# IpTraceable

IpTraceable requires client IP address:

nettrine.extensions.atlantic18:
    ipTraceable:
        ipValue: @Nette\Http\IRequest::getRemoteAddress()
1
2
3