Beloop\Component\User\Entity\User:
    type: entity
    repositoryClass: Beloop\Component\User\Repository\UserRepository
    table: user
    id:
        id:
            type: integer
            generator:
                strategy: AUTO
    fields:
        biography:
            column: biography
            type: text
            nullable: true
        website:
            column: website
            type: string
            length: 255
            nullable: true
        instagram:
            column: instagram
            type: string
            length: 255
            nullable: true
        avatarName:
            column: avatar
            type: string
            length: 255
            nullable: true

    oneToMany:
        images:
            targetEntity: Beloop\Component\Instagram\Entity\Instagram
            mappedBy: user

    manyToOne:
        language:
            targetEntity: Beloop\Component\Language\Entity\Interfaces\LanguageInterface
            joinColumn:
                name: language_iso
                referencedColumnName: iso
                nullable: true

    manyToMany:
        courses:
            targetEntity: Beloop\Component\Course\Entity\Interfaces\CourseInterface
            mappedBy: enrolledUsers

    lifecycleCallbacks:
            preUpdate: [loadUpdateAt]
            prePersist: [loadUpdateAt]
Beloop\Component\User\Entity\User:
    type: entity
    repositoryClass: Beloop\Component\User\Repository\UserRepository
    table: user
    id:
        id:
            type: integer
            generator:
                strategy: AUTO
    fields:
        biography:
            column: biography
            type: text
            nullable: true
        website:
            column: website
            type: string
            length: 255
            nullable: true
        instagram:
            column: instagram
            type: string
            length: 255
            nullable: true
        avatarName:
            column: avatar
            type: string
            length: 255
            nullable: true

    oneToMany:
        images:
            targetEntity: Beloop\Component\Instagram\Entity\Instagram
            mappedBy: user

    manyToOne:
        language:
            targetEntity: Beloop\Component\Language\Entity\Interfaces\LanguageInterface
            joinColumn:
                name: language_iso
                referencedColumnName: iso
                nullable: true

    manyToMany:
        courses:
            targetEntity: Beloop\Component\Course\Entity\Interfaces\CourseInterface
            mappedBy: enrolledUsers
            orderBy:
                startDate: DESC

    lifecycleCallbacks:
            preUpdate: [loadUpdateAt]
            prePersist: [loadUpdateAt]
Order user courses by start date
Order user courses by start date
