194 lines
3.8 KiB
PHP
194 lines
3.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\MailConfigurationRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity(repositoryClass: MailConfigurationRepository::class)]
|
|
#[ORM\Table(name: 'mail_configuration')]
|
|
class MailConfiguration
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(length: 10)]
|
|
private string $protocol = 'imap';
|
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
private ?string $imapHost = null;
|
|
|
|
#[ORM\Column]
|
|
private int $imapPort = 993;
|
|
|
|
#[ORM\Column(length: 10)]
|
|
private string $imapEncryption = 'ssl';
|
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
private ?string $smtpHost = null;
|
|
|
|
#[ORM\Column]
|
|
private int $smtpPort = 465;
|
|
|
|
#[ORM\Column(length: 10)]
|
|
private string $smtpEncryption = 'ssl';
|
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
private ?string $username = null;
|
|
|
|
#[ORM\Column(type: 'text', nullable: true)]
|
|
private ?string $encryptedPassword = null;
|
|
|
|
#[ORM\Column(length: 255)]
|
|
private string $sentFolderPath = 'Sent';
|
|
|
|
#[ORM\Column(type: 'boolean')]
|
|
private bool $enabled = false;
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getProtocol(): string
|
|
{
|
|
return $this->protocol;
|
|
}
|
|
|
|
public function setProtocol(string $protocol): static
|
|
{
|
|
$this->protocol = $protocol;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getImapHost(): ?string
|
|
{
|
|
return $this->imapHost;
|
|
}
|
|
|
|
public function setImapHost(?string $imapHost): static
|
|
{
|
|
$this->imapHost = $imapHost;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getImapPort(): int
|
|
{
|
|
return $this->imapPort;
|
|
}
|
|
|
|
public function setImapPort(int $imapPort): static
|
|
{
|
|
$this->imapPort = $imapPort;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getImapEncryption(): string
|
|
{
|
|
return $this->imapEncryption;
|
|
}
|
|
|
|
public function setImapEncryption(string $imapEncryption): static
|
|
{
|
|
$this->imapEncryption = $imapEncryption;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSmtpHost(): ?string
|
|
{
|
|
return $this->smtpHost;
|
|
}
|
|
|
|
public function setSmtpHost(?string $smtpHost): static
|
|
{
|
|
$this->smtpHost = $smtpHost;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSmtpPort(): int
|
|
{
|
|
return $this->smtpPort;
|
|
}
|
|
|
|
public function setSmtpPort(int $smtpPort): static
|
|
{
|
|
$this->smtpPort = $smtpPort;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSmtpEncryption(): string
|
|
{
|
|
return $this->smtpEncryption;
|
|
}
|
|
|
|
public function setSmtpEncryption(string $smtpEncryption): static
|
|
{
|
|
$this->smtpEncryption = $smtpEncryption;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getUsername(): ?string
|
|
{
|
|
return $this->username;
|
|
}
|
|
|
|
public function setUsername(?string $username): static
|
|
{
|
|
$this->username = $username;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getEncryptedPassword(): ?string
|
|
{
|
|
return $this->encryptedPassword;
|
|
}
|
|
|
|
public function setEncryptedPassword(?string $encryptedPassword): static
|
|
{
|
|
$this->encryptedPassword = $encryptedPassword;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSentFolderPath(): string
|
|
{
|
|
return $this->sentFolderPath;
|
|
}
|
|
|
|
public function setSentFolderPath(string $sentFolderPath): static
|
|
{
|
|
$this->sentFolderPath = $sentFolderPath;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function isEnabled(): bool
|
|
{
|
|
return $this->enabled;
|
|
}
|
|
|
|
public function setEnabled(bool $enabled): static
|
|
{
|
|
$this->enabled = $enabled;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function hasPassword(): bool
|
|
{
|
|
return null !== $this->encryptedPassword;
|
|
}
|
|
}
|