<?php
namespace App\Entity\Cart;
use App\Entity\PointsCatalog\CatalogSize;
use App\Repository\Cart\CartItemSizeRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CartItemSizeRepository::class)
*/
class CartItemSize
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private int $id;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Cart\CartItem", inversedBy="size")
* @ORM\JoinColumn(name="cart_item_id", referencedColumnName="id")
*/
private CartItem $cartItem;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\PointsCatalog\CatalogSize")
* @ORM\JoinColumn(name="size_id", referencedColumnName="id")
*/
private CatalogSize $size;
public function __construct(CartItem $cartItem, CatalogSize $size)
{
$this->cartItem = $cartItem;
$this->size = $size;
}
public function getId(): int
{
return $this->id;
}
public function getCartItem(): CartItem
{
return $this->cartItem;
}
public function cartItem(): CartItem
{
return $this->getCartItem();
}
public function getSize(): CatalogSize
{
return $this->size;
}
public function size(): CatalogSize
{
return $this->getSize();
}
}