<?php
namespace App\Entity;
use App\Repository\CustomerRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\User;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=CustomerRepository::class)
*/
class Customer extends User
{
/**
* @ORM\Column(type="integer")
*/
private $cin;
/**
* @ORM\Column(type="string", length=255)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $customer_code;
/**
* @ORM\OneToMany(targetEntity=Participant::class, mappedBy="customer")
*/
private $participant;
public function __construct()
{
$this->participant = new ArrayCollection();
}
public function getCin(): ?int
{
return $this->cin;
}
public function setCin(int $cin): self
{
$this->cin = $cin;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getCustomerCode(): ?string
{
return $this->customer_code;
}
public function setCustomerCode(string $customer_code): self
{
$this->customer_code = $customer_code;
return $this;
}
/**
* @return Collection<int, Participant>
*/
public function getParticipant(): Collection
{
return $this->participant;
}
public function addParticipant(Participant $participant): self
{
if (!$this->participant->contains($participant)) {
$this->participant[] = $participant;
$participant->setCustomer($this);
}
return $this;
}
public function removeParticipant(Participant $participant): self
{
if ($this->participant->removeElement($participant)) {
// set the owning side to null (unless already changed)
if ($participant->getCustomer() === $this) {
$participant->setCustomer(null);
}
}
return $this;
}
}