BitBag\SyliusCmsPlugin\Entity\Page:
    type: mappedSuperclass
    table: bitbag_cms_page
    id:
        id:
            type: integer
            id: true
            generator:
                strategy: AUTO
    fields:
        code:
            column: code
            type: string
            length: 250
            unique: true
        enabled:
            column: enabled
            type: boolean
        createdAt:
            column: created_at
            type: datetime
            nullable: true
            gedmo:
                timestampable:
                    on: create
        updatedAt:
            column: updated_at
            type: datetime
            nullable: true
            gedmo:
                timestampable:
                    on: update
        publishAt:
            column: publish_at
            type: datetime_immutable
            nullable: true

    manyToMany:
        products:
            targetEntity: Sylius\Component\Product\Model\ProductInterface
            joinTable:
                name: bitbag_cms_page_products
                joinColumns:
                    page_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    product_id:
                        referencedColumnName: id
                        onDelete: CASCADE
        sections:
            targetEntity: BitBag\SyliusCmsPlugin\Entity\SectionInterface
            joinTable:
                name: bitbag_cms_page_sections
                joinColumns:
                    block_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    section_id:
                        referencedColumnName: id
                        onDelete: CASCADE
        channels:
            targetEntity: Sylius\Component\Channel\Model\ChannelInterface
            joinTable:
                name: bitbag_cms_page_channels
                joinColumns:
                    page_id:
                        referencedColumnName: id
                        onDelete: CASCADE
                inverseJoinColumns:
                    channel_id:
                        referencedColumnName: id
                        onDelete: CASCADE
