<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\SmtpRepository")
* @ORM\Table(name="smtps", indexes={@ORM\Index(name="id_index", columns={"id"})})
*/
class Smtp
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=50, nullable=false)
*/
private $name;
/**
* @ORM\Column(type="string", length=254, nullable=false)
*/
private $username;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $password;
/**
* @ORM\Column(type="string", length=254, nullable=false)
*/
private $hostname;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private $port;
/**
* @ORM\Column(type="string", length=254, nullable=false)
*/
private $name_from;
/**
* @ORM\Column(type="string", length=254, nullable=false)
*/
private $email_from;
/**
* @ORM\Column(type="string", length=50, nullable=false)
*/
private $encryption;
/**
* @ORM\Column(type="string", length=50, nullable=false)
*/
private $auth_mode;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $is_default;
/**
* @ORM\Column(type="boolean", nullable=false)
*/
private $status;
/**
* @ORM\OneToMany(targetEntity="App\Entity\NotificationQueue", mappedBy="smtp")
*/
private $email_queue;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="smtps")
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id")
*/
private $customer;
public function __construct()
{
$this->email_queue = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getUsername(): ?string
{
return $this->username;
}
public function setUsername(string $username): self
{
$this->username = $username;
return $this;
}
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(?string $password): self
{
$this->password = $password;
return $this;
}
public function getHostname(): ?string
{
return $this->hostname;
}
public function setHostname(string $hostname): self
{
$this->hostname = $hostname;
return $this;
}
public function getPort(): ?int
{
return $this->port;
}
public function setPort(int $port): self
{
$this->port = $port;
return $this;
}
public function getNameFrom(): ?string
{
return $this->name_from;
}
public function setNameFrom(string $name_from): self
{
$this->name_from = $name_from;
return $this;
}
public function getEmailFrom(): ?string
{
return $this->email_from;
}
public function setEmailFrom(string $email_from): self
{
$this->email_from = $email_from;
return $this;
}
public function getEncryption(): ?string
{
return $this->encryption;
}
public function setEncryption(string $encryption): self
{
$this->encryption = $encryption;
return $this;
}
public function getAuthMode(): ?string
{
return $this->auth_mode;
}
public function setAuthMode(string $auth_mode): self
{
$this->auth_mode = $auth_mode;
return $this;
}
public function getIsDefault(): ?bool
{
return $this->is_default;
}
public function setIsDefault(bool $is_default): self
{
$this->is_default = $is_default;
return $this;
}
public function getStatus(): ?bool
{
return $this->status;
}
public function setStatus(bool $status): self
{
$this->status = $status;
return $this;
}
/**
* @return Collection<int, NotificationQueue>
*/
public function getEmailQueue(): Collection
{
return $this->email_queue;
}
public function addEmailQueue(NotificationQueue $emailQueue): self
{
if (!$this->email_queue->contains($emailQueue)) {
$this->email_queue[] = $emailQueue;
$emailQueue->setSmtp($this);
}
return $this;
}
public function removeEmailQueue(NotificationQueue $emailQueue): self
{
if ($this->email_queue->removeElement($emailQueue)) {
// set the owning side to null (unless already changed)
if ($emailQueue->getSmtp() === $this) {
$emailQueue->setSmtp(null);
}
}
return $this;
}
public function getCustomer(): ?Customer
{
return $this->customer;
}
public function setCustomer(?Customer $customer): self
{
$this->customer = $customer;
return $this;
}
}