src/Entity/Customer.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CustomerRepository;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass=CustomerRepository::class)
  8. */
  9. class Customer extends User
  10. {
  11. protected string $discr = 'customer';
  12. /**
  13. * @ORM\OneToMany(targetEntity=Delivery::class, mappedBy="requester", orphanRemoval=true)
  14. * @var Collection<int, Delivery> $deliveries
  15. */
  16. private Collection $deliveries;
  17. /**
  18. * @ORM\Column(type="text", nullable=true)
  19. */
  20. private ?string $signature;
  21. public function __construct()
  22. {
  23. parent::__construct();
  24. }
  25. /**
  26. * @return Collection<int, Delivery>
  27. */
  28. public function getDeliveries(): Collection
  29. {
  30. return $this->deliveries;
  31. }
  32. public function addDelivery(Delivery $delivery): self
  33. {
  34. if (!$this->deliveries->contains($delivery)) {
  35. $this->deliveries[] = $delivery;
  36. $delivery->setRequester($this);
  37. }
  38. return $this;
  39. }
  40. public function removeDelivery(Delivery $delivery): self
  41. {
  42. $this->deliveries->removeElement($delivery);
  43. return $this;
  44. }
  45. public function getDiscr(): string {
  46. return $this->discr;
  47. }
  48. public function getSignature(): ?string
  49. {
  50. return $this->signature;
  51. }
  52. public function setSignature(?string $signature): self
  53. {
  54. $this->signature = $signature;
  55. return $this;
  56. }
  57. }