<?php
namespace App\Entity;
use App\Repository\RelatieRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: RelatieRepository::class)]
class Relatie
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $naam = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $wadres = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $wpostcode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $wwoonplaats = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $telefoon = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $email = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $padres = null;
#[ORM\Column(length: 15, nullable: true)]
private ?string $ppostcode = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $pwoonplaats = null;
#[ORM\OneToMany(mappedBy: 'relatie', targetEntity: Order::class)]
private Collection $orders;
#[ORM\OneToMany(mappedBy: 'relatie', targetEntity: Prospect::class)]
private Collection $prospects;
public function __construct()
{
$this->orders = new ArrayCollection();
$this->prospects = new ArrayCollection();
}
public function __toString()
{
return($this->naam.', '.$this->wwoonplaats);
}
public function getId(): ?int
{
return $this->id;
}
public function getNaam(): ?string
{
return $this->naam;
}
public function setNaam(string $naam): self
{
$this->naam = $naam;
return $this;
}
public function getWadres(): ?string
{
return $this->wadres;
}
public function setWadres(?string $wadres): self
{
$this->wadres = $wadres;
return $this;
}
public function getWpostcode(): ?string
{
return $this->wpostcode;
}
public function setWpostcode(?string $wpostcode): self
{
$this->wpostcode = $wpostcode;
return $this;
}
public function getWwoonplaats(): ?string
{
return $this->wwoonplaats;
}
public function setWwoonplaats(?string $wwoonplaats): self
{
$this->wwoonplaats = $wwoonplaats;
return $this;
}
public function getTelefoon(): ?string
{
return $this->telefoon;
}
public function setTelefoon(?string $telefoon): self
{
$this->telefoon = $telefoon;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getPadres(): ?string
{
return $this->padres;
}
public function setPadres(?string $padres): self
{
$this->padres = $padres;
return $this;
}
public function getPpostcode(): ?string
{
return $this->ppostcode;
}
public function setPpostcode(?string $ppostcode): self
{
$this->ppostcode = $ppostcode;
return $this;
}
public function getPwoonplaats(): ?string
{
return $this->pwoonplaats;
}
public function setPwoonplaats(?string $pwoonplaats): self
{
$this->pwoonplaats = $pwoonplaats;
return $this;
}
/**
* @return Collection<int, Order>
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Order $order): self
{
if (!$this->orders->contains($order)) {
$this->orders->add($order);
$order->setRelatie($this);
}
return $this;
}
public function removeOrder(Order $order): self
{
if ($this->orders->removeElement($order)) {
// set the owning side to null (unless already changed)
if ($order->getRelatie() === $this) {
$order->setRelatie(null);
}
}
return $this;
}
/**
* @return Collection<int, Prospect>
*/
public function getProspects(): Collection
{
return $this->prospects;
}
public function addProspect(Prospect $prospect): self
{
if (!$this->prospects->contains($prospect)) {
$this->prospects->add($prospect);
$prospect->setRelatie($this);
}
return $this;
}
public function removeProspect(Prospect $prospect): self
{
if ($this->prospects->removeElement($prospect)) {
// set the owning side to null (unless already changed)
if ($prospect->getRelatie() === $this) {
$prospect->setRelatie(null);
}
}
return $this;
}
}