<?php
declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity()
*/
class Message implements MessageInterface
{
use ResourceTrait;
use TimestampableTrait;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Location", inversedBy="messages")
* @ORM\JoinColumn(name="location_id", nullable=true)
*/
private ?LocationInterface $location = null;
/**
* @ORM\Column(type="string", nullable=false)
*/
private ?string $type = null;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private ?string $name = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $phoneNumber = null;
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private ?string $email = null;
/**
* @ORM\Column(type="text", nullable=false)
*/
private ?string $message = null;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private bool $privacyPolicyAccepted = false;
public function __toString(): string
{
return sprintf('%s - %s', $this->type, $this->name);
}
public function getLocation(): ?LocationInterface
{
return $this->location;
}
public function setLocation(?LocationInterface $location): void
{
$this->location = $location;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): void
{
$this->type = $type;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): void
{
$this->name = $name;
}
public function getPhoneNumber(): ?string
{
return $this->phoneNumber;
}
public function setPhoneNumber(?string $phoneNumber): void
{
$this->phoneNumber = $phoneNumber;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): void
{
$this->email = $email;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(?string $message): void
{
$this->message = $message;
}
public function isPrivacyPolicyAccepted(): bool
{
return $this->privacyPolicyAccepted;
}
public function setPrivacyPolicyAccepted(bool $privacyPolicyAccepted): void
{
$this->privacyPolicyAccepted = $privacyPolicyAccepted;
}
}