App\Entity\DossierDocument:
    type: entity
    repositoryClass: App\Repository\DossierDocumentRepository
    table: dossier_document
    indexes:
        idx_dossier_document_dossier:
            columns: [ dossier_id ]
        idx_dossier_document_categorie:
            columns: [ categorie ]
        idx_dossier_document_date:
            columns: [ date_upload ]
    fields:
        id:
            id: true
            type: integer
            unsigned: false
            nullable: false
            generator:
                strategy: IDENTITY
        categorie:
            type: string
            length: 50
            fixed: false
            nullable: false
        nom:
            type: string
            length: 255
            fixed: false
            nullable: false
        cheminFichier:
            type: string
            length: 500
            fixed: false
            nullable: false
            column: chemin_fichier
        mimeType:
            type: string
            length: 100
            fixed: false
            nullable: true
            column: mime_type
        taille:
            type: integer
            nullable: true
        description:
            type: text
            nullable: true
        dateUpload:
            type: datetime
            nullable: false
            column: date_upload
    manyToOne:
        dossier:
            targetEntity: Dossier
            inversedBy: documents
            joinColumn:
                name: dossier_id
                referencedColumnName: id
                nullable: false
                onDelete: CASCADE
        utilisateur:
            targetEntity: Utilisateur
            joinColumn:
                name: utilisateur_id
                referencedColumnName: id
                nullable: false
    lifecycleCallbacks:
        prePersist: [setDateUploadValue]
