src/Entity/Cart/CartItemSize.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Cart;
  3. use App\Entity\PointsCatalog\CatalogSize;
  4. use App\Repository\Cart\CartItemSizeRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=CartItemSizeRepository::class)
  8.  */
  9. class CartItemSize
  10. {
  11.     /**
  12.      * @ORM\Column(name="id", type="integer")
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue(strategy="AUTO")
  15.      */
  16.     private int $id;
  17.     /**
  18.      * @ORM\OneToOne(targetEntity="App\Entity\Cart\CartItem", inversedBy="size")
  19.      * @ORM\JoinColumn(name="cart_item_id", referencedColumnName="id")
  20.      */
  21.     private CartItem $cartItem;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity="App\Entity\PointsCatalog\CatalogSize")
  24.      * @ORM\JoinColumn(name="size_id", referencedColumnName="id")
  25.      */
  26.     private CatalogSize $size;
  27.     public function __construct(CartItem $cartItemCatalogSize $size)
  28.     {
  29.         $this->cartItem $cartItem;
  30.         $this->size $size;
  31.     }
  32.     public function getId(): int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getCartItem(): CartItem
  37.     {
  38.         return $this->cartItem;
  39.     }
  40.     public function cartItem(): CartItem
  41.     {
  42.         return $this->getCartItem();
  43.     }
  44.     public function getSize(): CatalogSize
  45.     {
  46.         return $this->size;
  47.     }
  48.     public function size(): CatalogSize
  49.     {
  50.         return $this->getSize();
  51.     }
  52. }