src/Entity/Sms/DeliveryContact.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Sms;
  3. use App\Doctrine\Generator\DeliveryContactIdGenerator;
  4. use App\Entity\MiniAbstractBase;
  5. use App\Entity\Traits\NameTrait;
  6. use App\Entity\Traits\PhoneTrait;
  7. use App\Repository\Sms\DeliveryContactRepository;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10.  * @ORM\Table(name="vulco_delivery_contact")
  11.  *
  12.  * @ORM\Entity(repositoryClass=DeliveryContactRepository::class)
  13.  */
  14. class DeliveryContact
  15. {
  16.     use NameTrait;
  17.     use PhoneTrait;
  18.     /**
  19.      * @ORM\Id
  20.      *
  21.      * @ORM\Column(type="delivery_contact_id", length=255, nullable=false)
  22.      *
  23.      * @ORM\GeneratedValue(strategy="CUSTOM")
  24.      *
  25.      * @ORM\CustomIdGenerator(class=DeliveryContactIdGenerator::class)
  26.      */
  27.     private string $id;
  28.     /**
  29.      * @ORM\Column(type="string", nullable=false)
  30.      */
  31.     private string $name;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity="App\Entity\Sms\DeliveryList", inversedBy="deliveryContacts")
  34.      *
  35.      * @ORM\JoinColumn(name="delivery_list_id", referencedColumnName="id")
  36.      */
  37.     private DeliveryList $deliveryList;
  38.     public function getDeliveryList(): DeliveryList
  39.     {
  40.         return $this->deliveryList;
  41.     }
  42.     public function setDeliveryList(DeliveryList $deliveryList): self
  43.     {
  44.         $this->deliveryList $deliveryList;
  45.         return $this;
  46.     }
  47.     public function __toString(): string
  48.     {
  49.         return $this->id $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  50.     }
  51. }