<?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) Paweł Jędrzejewski

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                                      http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <mapped-superclass name="Sylius\Bundle\CoreBundle\Model\Variant" table="sylius_variant">
        <field name="sku" column="sku" type="string" nullable="true" />
        <field name="price" column="price" type="integer" />
        <field name="onHand" column="on_hand" type="integer" />
        <field name="availableOnDemand" column="available_on_demand" type="boolean"/>

        <one-to-many field="images" target-entity="Sylius\Bundle\CoreBundle\Model\VariantImage" mapped-by="variant">
            <cascade>
                <cascade-all />
            </cascade>
        </one-to-many>
    </mapped-superclass>

</doctrine-mapping>

<?xml version="1.0" encoding="UTF-8"?>

<!--

 This file is part of the Sylius package.

 (c) Paweł Jędrzejewski

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                                      http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <mapped-superclass name="Sylius\Bundle\CoreBundle\Model\Variant" table="sylius_variant">
        <field name="sku" column="sku" type="string" nullable="true" />
        <field name="price" column="price" type="integer" />
        <field name="onHand" column="on_hand" type="integer" />
        <field name="availableOnDemand" column="available_on_demand" type="boolean"/>

        <one-to-many field="images" target-entity="Sylius\Bundle\CoreBundle\Model\VariantImageInterface" mapped-by="variant">
            <cascade>
                <cascade-all />
            </cascade>
        </one-to-many>
    </mapped-superclass>

</doctrine-mapping>

Use interface instead of entity in doctrine mappings
Use interface instead of entity in doctrine mappings
