<?php
declare(strict_types=1);
namespace App\Entity\Customer;
use Doctrine\ORM\Mapping as ORM;
use Sylius\B2BKit\Entity\CustomerAwareTrait;
use Sylius\B2BKit\Entity\CustomerInterface;
use Sylius\B2BKit\Entity\OrganizationInterface;
use Sylius\Component\Core\Model\Customer as BaseCustomer;
/**
* @ORM\Entity
* @ORM\Table(name="sylius_customer")
*/
class Customer extends BaseCustomer implements CustomerInterface
{
use CustomerAwareTrait;
/**
* @ORM\ManyToOne(
* targetEntity="Sylius\B2BKit\Entity\OrganizationInterface",
* inversedBy="customers",
* cascade={"all"},
* )
* @ORM\JoinColumn(
* name="organization_id",
* referencedColumnName="id",
* nullable=true,
* onDelete="SET NULL",
* )
*/
protected ?OrganizationInterface $organization = null;
}
Override Customer
config
# config/packages/_sylius.yaml
sylius_customer:
resources:
customer:
classes:
model: App\Entity\Customer\Customer
repository: Sylius\B2BKit\Repository\CustomerRepository