<?php
namespace App\Entity\Sms;
use App\Doctrine\Generator\SMSComunicationRowIdGenerator;
use App\Entity\MiniAbstractBase;
use App\Entity\Traits\NameTrait;
use App\Entity\Traits\PhoneTrait;
use App\Enum\SmsCommunicationRowStatusEnum;
use App\Repository\Sms\SMSComunicationRowRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="vulco_sms_comunication_row")
*
* @ORM\Entity(repositoryClass=SMSComunicationRowRepository::class)
*/
class SMSComunicationRow
{
use NameTrait;
use PhoneTrait;
/**
* @ORM\Id
*
* @ORM\Column(type="sms_comunication_row_id", length=255, nullable=false)
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class=SMSComunicationRowIdGenerator::class)
*/
private string $id;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $name;
/**
* @ORM\Column(type="text", length=10000, nullable=false)
*/
private string $status;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
*/
private ?string $message = null;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private string $notificationId;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Sms\PreparedSMSCommunication", inversedBy="rows")
*
* @ORM\JoinColumn(name="comunication_id", referencedColumnName="id")
*/
private PreparedSMSCommunication $communication;
public function getId(): string
{
return $this->id;
}
public function getStatus(): string
{
return $this->status;
}
public function getTranslatedStatusString(): string
{
return SmsCommunicationRowStatusEnum::getTranslatedEnumArray()[$this->status];
}
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): self
{
$this->message = $message;
return $this;
}
public function getNotificationId(): string
{
return $this->notificationId;
}
public function setNotificationId(string $notificationId): self
{
$this->notificationId = $notificationId;
return $this;
}
public function getCommunication(): PreparedSMSCommunication
{
return $this->communication;
}
public function setCommunication(PreparedSMSCommunication $communication): self
{
$this->communication = $communication;
return $this;
}
public function __toString(): string
{
return $this->id ? $this->getId() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}