BitBag\SyliusCmsPlugin\Entity\Block:
    type: mappedSuperclass
    table: bitbag_cms_block
    id:
        id:
            type: integer
            id: true
            generator:
                strategy: AUTO
    fields:
        code:
            column: code
            type: string
            length: 64
            unique: true
        enabled:
            column: enabled
            type: boolean
    manyToMany:
        sections:
            targetEntity: BitBag\SyliusCmsPlugin\Entity\SectionInterface
            joinTable:
                name: bitbag_cms_block_sections
                joinColumns:
                    block_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    section_id:
                        referencedColumnName: id
                        onDelete: CASCADE
        products:
            targetEntity: Sylius\Component\Product\Model\ProductInterface
            joinTable:
                name: bitbag_cms_block_products
                joinColumns:
                    block_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    product_id:
                        referencedColumnName: id
                        onDelete: CASCADE


        taxonomies:
            targetEntity: Sylius\Component\Taxonomy\Model\TaxonInterface
            joinTable:
                name: bitbag_cms_block_taxonomies
                joinColumns:
                    block_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    taxon_id:
                        referencedColumnName: id
                        onDelete: CASCADE

        channels:
            targetEntity: Sylius\Component\Channel\Model\ChannelInterface
            joinTable:
                name: bitbag_cms_block_channels
                joinColumns:
                    block_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    channel_id:
                        referencedColumnName: id
                        onDelete: CASCADE
