Override / extends ShopUser model in Sylius

Hello,

I need to override ShopUser model. I have found some solutions, but not actual (for very old version of Sylius).

I have:

ShopUser.php

<?php

namespace App\Entity;

use Sylius\Component\Core\Model\ShopUser as BaseShopUser;
use Sylius\Component\User\Model\User as BaseUser;

class ShopUser extends BaseShopUser
{

    private $photoIncomingUser;

    public function getPhotoIncomingUser(): ?PhotoIncomingUser
    {
        return $this->photoIncomingUser;
    }

    public function setPhotoIncomingUser(?PhotoIncomingUser $photoIncomingUser): self
    {
        $this->photoIncomingUser = $photoIncomingUser;

        return $this;
    }
}

ShopUser.orm.yml

App\Entity\ShopUser:
    type: mappedSuperclass
    table: sylius_shop_user

    oneToOne:
        photoIncomingUser:
            targetEntity: App\Entity\PhotoIncomingUser
            mappedBy: shopUser

from _sylius.yaml

sylius_user:
    resources:
        shop:
            user:
                classes:
                    model: App\Entity\ShopUser

When I want to login, I got error: Authentication request could not be processed due to a system problem.

Do you have any working example? Thank you.

Petr Hamak

Nobody knows? :frowning:

Could you provide more details about problem, this “due to a system problem” is not clear.