src/Entity/Order.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClassOrderRepository::class)]
  10. #[ORM\Table(name'`order`')]
  11. class Order
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private int $id;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     #[Assert\NotBlank]
  19.     #[Assert\Type(\DateTime::class)]
  20.     private \DateTimeInterface $issuedAt;
  21.     #[ORM\Column]
  22.     #[Assert\NotBlank]
  23.     private bool $paid false;
  24.     #[ORM\Column]
  25.     #[Assert\NotBlank]
  26.     private int $variableSymbol;
  27.     #[ORM\OneToMany(mappedBy'order'targetEntityPicture::class)]
  28.     #[ORM\JoinColumn(name"order_id"referencedColumnName"id"nullablefalse)]
  29.     private Collection $pictures;
  30.     #[ORM\ManyToOne(inversedBy'orders')]
  31.     #[ORM\JoinColumn(nullabletrue)]
  32.     private ?User $user;
  33.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  34.     private \DateTimeInterface $deliveryDate;
  35.     #[ORM\Column(length255)]
  36.     private ?string $code null;
  37.     #[ORM\Column(typeTypes::DECIMALprecision10scale2nullablefalse)]
  38.     private string $price;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $deliveryCity null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $deliveryStreet1 null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $deliveryStreet2 null;
  45.     #[ORM\Column(length255nullabletrue)]
  46.     private ?string $deliveryZipCode null;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $deliveryState null;
  49.     #[ORM\Column(length255nullabletrue)]
  50.     private ?string $deliveryFirstname null;
  51.     #[ORM\Column(length255nullabletrue)]
  52.     private ?string $deliveryLastname null;
  53.     #[ORM\Column(length255nullabletrue)]
  54.     private ?string $deliveryPhone null;
  55.     #[ORM\Column(length180nullabletrue)]
  56.     #[Assert\NotBlank]
  57.     #[Assert\Email]
  58.     private ?string $deliveryEmail null;
  59.     #[ORM\Column(length255nullabletrue)]
  60.     private ?string $paymentId null;
  61.     #[ORM\Column(typeTypes::DECIMALprecision10scale'0')]
  62.     private ?string $finalPrice null;
  63.     #[ORM\Column(length255nullablefalse)]
  64.     private string $billingState;
  65.     #[ORM\Column(length255nullablefalse)]
  66.     private string $billingCity;
  67.     #[ORM\Column(length255nullablefalse)]
  68.     private string $billingZipCode;
  69.     #[ORM\Column(length255nullablefalse)]
  70.     private string $billingStreet;
  71.     #[ORM\Column(length255nullabletrue)]
  72.     private ?string $billingStreet2 null;
  73.     #[ORM\Column(length255nullablefalse)]
  74.     private string $billingPhone;
  75.     #[ORM\Column(length255nullablefalse)]
  76.     private string $billingEmail;
  77.     #[ORM\Column(length255nullablefalse)]
  78.     private string $billingFirstname;
  79.     #[ORM\Column(length255nullablefalse)]
  80.     private string $billingLastname;
  81.     #[ORM\Column(typeTypes::TEXTlength65535)]
  82.     private ?string $text null;
  83.     #[ORM\OneToOne(inversedBy'associatedOrder'cascade: ['persist''remove'])]
  84.     #[ORM\JoinColumn(nullabletrue)]
  85.     private ?Invoice $invoice null;
  86.     #[ORM\ManyToOne]
  87.     #[ORM\JoinColumn(nullablefalse)]
  88.     private ?Template $template null;
  89.     public function __construct()
  90.     {
  91.         $this->pictures = new ArrayCollection();
  92.     }
  93.     public function getId(): ?int
  94.     {
  95.         return $this->id;
  96.     }
  97.     public function setId($id): self
  98.     {
  99.         $this->id $id;
  100.         return $this;
  101.     }
  102.     public function getIssuedAt(): ?\DateTimeInterface
  103.     {
  104.         return $this->issuedAt;
  105.     }
  106.     public function setIssuedAt(\DateTimeInterface $issuedAt): self
  107.     {
  108.         $this->issuedAt $issuedAt;
  109.         return $this;
  110.     }
  111.     public function isPaid(): ?bool
  112.     {
  113.         return $this->paid;
  114.     }
  115.     public function setPaid(bool $paid): self
  116.     {
  117.         $this->paid $paid;
  118.         return $this;
  119.     }
  120.     public function getVariableSymbol(): ?int
  121.     {
  122.         return $this->variableSymbol;
  123.     }
  124.     public function setVariableSymbol(int $variableSymbol): self
  125.     {
  126.         $this->variableSymbol $variableSymbol;
  127.         return $this;
  128.     }
  129.     /**
  130.      * @return Collection<int, Picture>
  131.      */
  132.     public function getPictures(): Collection
  133.     {
  134.         return $this->pictures;
  135.     }
  136.     public function addPicture(Picture $picture): self
  137.     {
  138.         if (!$this->pictures->contains($picture)) {
  139.             $this->pictures->add($picture);
  140.             $picture->setOrderId($this);
  141.         }
  142.         return $this;
  143.     }
  144.     public function removePicture(Picture $picture): self
  145.     {
  146.         if ($this->pictures->removeElement($picture)) {
  147.             // set the owning side to null (unless already changed)
  148.             if ($picture->getOrderId() === $this) {
  149.                 $picture->setOrderId(null);
  150.             }
  151.         }
  152.         return $this;
  153.     }
  154.     public function getUser(): ?User
  155.     {
  156.         return $this->user;
  157.     }
  158.     public function setUser(?User $user): self
  159.     {
  160.         $this->user $user;
  161.         return $this;
  162.     }
  163.     public function getDeliveryDate(): ?\DateTimeInterface
  164.     {
  165.         return $this->deliveryDate;
  166.     }
  167.     public function setDeliveryDate(\DateTimeInterface $deliveryDate): self
  168.     {
  169.         $this->deliveryDate $deliveryDate;
  170.         return $this;
  171.     }
  172.     public function getCode(): ?string
  173.     {
  174.         return $this->code;
  175.     }
  176.     public function setCode(string $code): self
  177.     {
  178.         $this->code $code;
  179.         return $this;
  180.     }
  181.     public function getPrice(): string
  182.     {
  183.         return $this->price;
  184.     }
  185.     public function setPrice(string $price): self
  186.     {
  187.         $this->price $price;
  188.         return $this;
  189.     }
  190.     public function getDeliveryCity(): ?string
  191.     {
  192.         return $this->deliveryCity;
  193.     }
  194.     public function setDeliveryCity(string $deliveryCity): self
  195.     {
  196.         $this->deliveryCity $deliveryCity;
  197.         return $this;
  198.     }
  199.     public function getDeliveryStreet1(): ?string
  200.     {
  201.         return $this->deliveryStreet1;
  202.     }
  203.     public function setDeliveryStreet1(string $deliveryStreet1): self
  204.     {
  205.         $this->deliveryStreet1 $deliveryStreet1;
  206.         return $this;
  207.     }
  208.     public function getDeliveryStreet2(): ?string
  209.     {
  210.         return $this->deliveryStreet2;
  211.     }
  212.     public function setDeliveryStreet2(string $deliveryStreet2): self
  213.     {
  214.         $this->deliveryStreet2 $deliveryStreet2;
  215.         return $this;
  216.     }
  217.     public function getDeliveryZipCode(): ?string
  218.     {
  219.         return $this->deliveryZipCode;
  220.     }
  221.     public function setDeliveryZipCode(string $deliveryZipCode): self
  222.     {
  223.         $this->deliveryZipCode $deliveryZipCode;
  224.         return $this;
  225.     }
  226.     public function getDeliveryState(): ?string
  227.     {
  228.         return $this->deliveryState;
  229.     }
  230.     public function setDeliveryState(string $deliveryState): self
  231.     {
  232.         $this->deliveryState $deliveryState;
  233.         return $this;
  234.     }
  235.     public function getDeliveryFirstname(): ?string
  236.     {
  237.         return $this->deliveryFirstname;
  238.     }
  239.     public function setDeliveryFirstname(string $deliveryFirstname): self
  240.     {
  241.         $this->deliveryFirstname $deliveryFirstname;
  242.         return $this;
  243.     }
  244.     public function getDeliveryLastname(): ?string
  245.     {
  246.         return $this->deliveryLastname;
  247.     }
  248.     public function setDeliveryLastname(string $deliveryLastname): self
  249.     {
  250.         $this->deliveryLastname $deliveryLastname;
  251.         return $this;
  252.     }
  253.     public function getDeliveryPhone(): ?string
  254.     {
  255.         return $this->deliveryPhone;
  256.     }
  257.     public function setDeliveryPhone(string $deliveryPhone): self
  258.     {
  259.         $this->deliveryPhone $deliveryPhone;
  260.         return $this;
  261.     }
  262.     public function getDeliveryEmail(): ?string
  263.     {
  264.         return $this->deliveryEmail;
  265.     }
  266.     public function setDeliveryEmail(string $deliveryEmail): self
  267.     {
  268.         $this->deliveryEmail $deliveryEmail;
  269.         return $this;
  270.     }
  271.     public function getPaymentId(): ?string
  272.     {
  273.         return $this->paymentId;
  274.     }
  275.     public function setPaymentId(string $paymentId): self
  276.     {
  277.         $this->paymentId $paymentId;
  278.         return $this;
  279.     }
  280.     public function getFinalPrice(): ?string
  281.     {
  282.         return $this->finalPrice;
  283.     }
  284.     public function setFinalPrice(string $finalPrice): self
  285.     {
  286.         $this->finalPrice $finalPrice;
  287.         return $this;
  288.     }
  289.     public function getBillingState(): string
  290.     {
  291.         return $this->billingState;
  292.     }
  293.     public function setBillingState(string $billingState): self
  294.     {
  295.         $this->billingState $billingState;
  296.         return $this;
  297.     }
  298.     public function getBillingCity(): string
  299.     {
  300.         return $this->billingCity;
  301.     }
  302.     public function setBillingCity(string $billingCity): self
  303.     {
  304.         $this->billingCity $billingCity;
  305.         return $this;
  306.     }
  307.     public function getBillingZipCode(): string
  308.     {
  309.         return $this->billingZipCode;
  310.     }
  311.     public function setBillingZipCode(string $billingZipCode): self
  312.     {
  313.         $this->billingZipCode $billingZipCode;
  314.         return $this;
  315.     }
  316.     public function getBillingStreet(): string
  317.     {
  318.         return $this->billingStreet;
  319.     }
  320.     public function setBillingStreet(string $billingStreet): self
  321.     {
  322.         $this->billingStreet $billingStreet;
  323.         return $this;
  324.     }
  325.     public function getBillingStreet2(): ?string
  326.     {
  327.         return $this->billingStreet2;
  328.     }
  329.     public function setBillingStreet2(string $billingStreet2): self
  330.     {
  331.         $this->billingStreet2 $billingStreet2;
  332.         return $this;
  333.     }
  334.     public function getBillingPhone(): string
  335.     {
  336.         return $this->billingPhone;
  337.     }
  338.     public function setBillingPhone(string $billingPhone): self
  339.     {
  340.         $this->billingPhone $billingPhone;
  341.         return $this;
  342.     }
  343.     public function getBillingEmail(): string
  344.     {
  345.         return $this->billingEmail;
  346.     }
  347.     public function setBillingEmail(string $billingEmail): self
  348.     {
  349.         $this->billingEmail $billingEmail;
  350.         return $this;
  351.     }
  352.     public function getBillingFirstname(): string
  353.     {
  354.         return $this->billingFirstname;
  355.     }
  356.     public function setBillingFirstname(string $billingFirstname): self
  357.     {
  358.         $this->billingFirstname $billingFirstname;
  359.         return $this;
  360.     }
  361.     public function getBillingLastname(): string
  362.     {
  363.         return $this->billingLastname;
  364.     }
  365.     public function setBillingLastname(string $billingLastname): self
  366.     {
  367.         $this->billingLastname $billingLastname;
  368.         return $this;
  369.     }
  370.     public function getText(): ?string
  371.     {
  372.         return $this->text;
  373.     }
  374.     public function setText(string $text): self
  375.     {
  376.         $this->text $text;
  377.         return $this;
  378.     }
  379.     public function getInvoice(): ?Invoice
  380.     {
  381.         return $this->invoice;
  382.     }
  383.     public function setInvoice(Invoice $invoice): self
  384.     {
  385.         $this->invoice $invoice;
  386.         return $this;
  387.     }
  388.     public function getTemplate(): ?Template
  389.     {
  390.         return $this->template;
  391.     }
  392.     public function setTemplate(?Template $template): self
  393.     {
  394.         $this->template $template;
  395.         return $this;
  396.     }
  397.     
  398.     public function __toString(): string
  399.     {
  400.         // Replace 'id' with the property you want to use to represent the Order
  401.         return (string) $this->id;
  402.     }
  403. }