Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 928 Bytes

01.6-shop-user.md

File metadata and controls

47 lines (36 loc) · 928 Bytes

Sylius B2B Kit

Installation

Add trait to ShopUser entity class

<?php

declare(strict_types=1);

namespace App\Entity\User;

use Doctrine\ORM\Mapping as ORM;
use Sylius\B2BKit\Entity\ShopUserAwareTrait;
use Sylius\B2BKit\Entity\ShopUserInterface;
use Sylius\Component\Core\Model\ShopUser as BaseShopUser;

/**
 * @ORM\Entity
 * @ORM\Table(name="sylius_shop_user")
 */
class ShopUser extends BaseShopUser implements ShopUserInterface
{
    use ShopUserAwareTrait;

    /**
     * @ORM\Column(type="string", nullable="true")
     */
    protected ?string $activationToken = null;
}

Override ShopUser config

# config/packages/_sylius.yaml

sylius_user:
    resources:
        shop:
            user:
                classes:
                    model: App\Entity\User\ShopUser
                    repository: Sylius\B2BKit\Repository\UserRepository