src/Entity/OrderDetails.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderDetailsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=OrderDetailsRepository::class)
  7.  */
  8. class OrderDetails
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity=Order::class, inversedBy="orderDetails")
  18.      * @ORM\JoinColumn(nullable=false)
  19.      */
  20.     private $myOrder;
  21.     /**
  22.      * @ORM\Column(type="string", length=255)
  23.      */
  24.     private $product;
  25.     /**
  26.      * @ORM\Column(type="integer")
  27.      */
  28.     private $quantity;
  29.     /**
  30.      * @ORM\Column(type="float")
  31.      */
  32.     private $price;
  33.     /**
  34.      * @ORM\Column(type="float")
  35.      */
  36.     private $total;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getMyOrder(): ?Order
  42.     {
  43.         return $this->myOrder;
  44.     }
  45.     public function setMyOrder(?Order $myOrder): self
  46.     {
  47.         $this->myOrder $myOrder;
  48.         return $this;
  49.     }
  50.     public function getProduct(): ?string
  51.     {
  52.         return $this->product;
  53.     }
  54.     public function setProduct(string $product): self
  55.     {
  56.         $this->product $product;
  57.         return $this;
  58.     }
  59.     public function getQuantity(): ?int
  60.     {
  61.         return $this->quantity;
  62.     }
  63.     public function setQuantity(int $quantity): self
  64.     {
  65.         $this->quantity $quantity;
  66.         return $this;
  67.     }
  68.     public function getPrice(): ?float
  69.     {
  70.         return $this->price;
  71.     }
  72.     public function setPrice(float $price): self
  73.     {
  74.         $this->price $price;
  75.         return $this;
  76.     }
  77.     public function getTotal(): ?float
  78.     {
  79.         return $this->total;
  80.     }
  81.     public function setTotal(float $total): self
  82.     {
  83.         $this->total $total;
  84.         return $this;
  85.     }
  86.     public function __toString()
  87.     {
  88.         return $this->getProduct().' x '.$this->getQuantity();
  89.     }
  90. }