<?php
namespace App\Entity;
use App\Repository\CustomerRepository;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CustomerRepository::class)
*/
class Customer extends User
{
protected string $discr = 'customer';
/**
* @ORM\OneToMany(targetEntity=Delivery::class, mappedBy="requester", orphanRemoval=true)
* @var Collection<int, Delivery> $deliveries
*/
private Collection $deliveries;
/**
* @ORM\Column(type="text", nullable=true)
*/
private ?string $signature;
public function __construct()
{
parent::__construct();
}
/**
* @return Collection<int, Delivery>
*/
public function getDeliveries(): Collection
{
return $this->deliveries;
}
public function addDelivery(Delivery $delivery): self
{
if (!$this->deliveries->contains($delivery)) {
$this->deliveries[] = $delivery;
$delivery->setRequester($this);
}
return $this;
}
public function removeDelivery(Delivery $delivery): self
{
$this->deliveries->removeElement($delivery);
return $this;
}
public function getDiscr(): string {
return $this->discr;
}
public function getSignature(): ?string
{
return $this->signature;
}
public function setSignature(?string $signature): self
{
$this->signature = $signature;
return $this;
}
}