<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
                                            http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">

    <document name="Lexik\Bundle\TranslationBundle\Document\File"
              collection="lexik_translation_file"
              repository-class="Lexik\Bundle\TranslationBundle\Document\FileRepository">

        <lifecycle-callbacks>
            <lifecycle-callback type="prePersist" method="prePersist" />
            <lifecycle-callback type="preUpdate" method="preUpdate" />
        </lifecycle-callbacks>

        <id field-name="id" strategy="auto" />

        <reference-many field="translations" target-document="Lexik\Bundle\TranslationBundle\Document\Translation" mapped-by="file">
            <cascade>
                <persist/>
            </cascade>
        </reference-many>

    </document>
</doctrine-mongo-mapping>
