<?php
namespace App\Entity\Sms;
use App\Doctrine\Generator\DeliveryContactIdGenerator;
use App\Entity\MiniAbstractBase;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\PhoneTrait;
use App\Repository\Sms\DeliveryContactRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="vulco_delivery_contact")
*
* @ORM\Entity(repositoryClass=DeliveryContactRepository::class)
*/
class DeliveryContact
{
use NameTrait;
use PhoneTrait;
/**
* @ORM\Id
*
* @ORM\Column(type="delivery_contact_id", length=255, nullable=false)
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class=DeliveryContactIdGenerator::class)
*/
private string $id;
/**
* @ORM\Column(type="string", nullable=false)
*/
private string $name;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Sms\DeliveryList", inversedBy="deliveryContacts")
*
* @ORM\JoinColumn(name="delivery_list_id", referencedColumnName="id")
*/
private DeliveryList $deliveryList;
public function getDeliveryList(): DeliveryList
{
return $this->deliveryList;
}
public function setDeliveryList(DeliveryList $deliveryList): self
{
$this->deliveryList = $deliveryList;
return $this;
}
public function __toString(): string
{
return $this->id ? $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}