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

<!--

 This file is part of the Sylius package.

 (c) Sylius Sp. z o.o.

 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\Component\Core\Model\AdminUser" table="sylius_admin_user">
        <field name="firstName" column="first_name" type="string" nullable="true" />
        <field name="lastName" column="last_name" type="string" nullable="true" />
        <field name="localeCode" column="locale_code" type="string" length="12" />

        <one-to-one field="avatar" target-entity="Sylius\Component\Core\Model\AvatarImageInterface" mapped-by="owner" orphan-removal="true">
            <cascade>
                <cascade-all/>
            </cascade>
        </one-to-one>
    </mapped-superclass>

</doctrine-mapping>
