BitBag\SyliusCmsPlugin\Entity\Media:
    type: mappedSuperclass
    table: bitbag_cms_media
    id:
        id:
            type: integer
            id: true
            generator:
                strategy: AUTO
    fields:
        code:
            column: code
            type: string
            length: 250
            unique: true
        type:
            column: type
            type: string
            length: 250
        path:
            column: path
            type: string
            length: 250
            unique: true
        mimeType:
            column: mime_type
            type: string
            length: 250
            nullable: true
        enabled:
            column: enabled
            type: boolean
        width:
            column: width
            type: integer
            nullable: true
        height:
            column: height
            type: integer
            nullable: true

    manyToMany:
        sections:
            targetEntity: BitBag\SyliusCmsPlugin\Entity\SectionInterface
            joinTable:
                name: bitbag_cms_media_sections
                joinColumns:
                    media_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    section_id:
                        referencedColumnName: id
                        onDelete: CASCADE
        products:
            targetEntity: Sylius\Component\Product\Model\ProductInterface
            joinTable:
                name: bitbag_cms_media_products
                joinColumns:
                    media_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    product_id:
                        referencedColumnName: id
                        onDelete: CASCADE
        channels:
            targetEntity: Sylius\Component\Channel\Model\ChannelInterface
            joinTable:
                name: bitbag_cms_media_channels
                joinColumns:
                    block_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    channel_id:
                        referencedColumnName: id
                        onDelete: CASCADE
