for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* 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.
*/
namespace Sylius\Component\Core\Model;
use Sylius\Component\Cart\Model\CartItem;
use Sylius\Component\Order\Model\OrderItemInterface as BaseOrderItemInterface;
/**
* @author Paweł Jędrzejewski <[email protected]>
class OrderItem extends CartItem implements OrderItemInterface
{
* @var ProductVariantInterface
protected $variant;
* {@inheritdoc}
public function getProduct()
return $this->variant->getProduct();
}
public function getVariant()
return $this->variant;
public function setVariant(ProductVariantInterface $variant)
$this->variant = $variant;
public function equals(BaseOrderItemInterface $item)
return parent::equals($item) || ($item instanceof self
&& $item->getVariant() === $this->variant
);