src/Entity/Smtp.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\SmtpRepository")
  8.  * @ORM\Table(name="smtps", indexes={@ORM\Index(name="id_index", columns={"id"})})
  9.  */
  10. class Smtp
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\GeneratedValue(strategy="AUTO")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=50, nullable=false)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=254, nullable=false)
  24.      */
  25.     private $username;
  26.     /**
  27.      * @ORM\Column(type="string", length=100, nullable=true)
  28.      */
  29.     private $password;
  30.     /**
  31.      * @ORM\Column(type="string", length=254, nullable=false)
  32.      */
  33.     private $hostname;
  34.     /**
  35.      * @ORM\Column(type="integer", nullable=false)
  36.      */
  37.     private $port;
  38.     /**
  39.      * @ORM\Column(type="string", length=254, nullable=false)
  40.      */
  41.     private $name_from;
  42.     /**
  43.      * @ORM\Column(type="string", length=254, nullable=false)
  44.      */
  45.     private $email_from;
  46.     /**
  47.      * @ORM\Column(type="string", length=50, nullable=false)
  48.      */
  49.     private $encryption;
  50.     /**
  51.      * @ORM\Column(type="string", length=50, nullable=false)
  52.      */
  53.     private $auth_mode;
  54.     /**
  55.      * @ORM\Column(type="boolean", nullable=false)
  56.      */
  57.     private $is_default;
  58.     /**
  59.      * @ORM\Column(type="boolean", nullable=false)
  60.      */
  61.     private $status;
  62.     /**
  63.      * @ORM\OneToMany(targetEntity="App\Entity\NotificationQueue", mappedBy="smtp")
  64.      */
  65.     private $email_queue;
  66.     /**
  67.      * @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="smtps")
  68.      * @ORM\JoinColumn(name="customer_id", referencedColumnName="id")
  69.      */
  70.     private $customer;
  71.     public function __construct()
  72.     {
  73.         $this->email_queue = new ArrayCollection();
  74.     }
  75.     public function getId(): ?int
  76.     {
  77.         return $this->id;
  78.     }
  79.     public function getName(): ?string
  80.     {
  81.         return $this->name;
  82.     }
  83.     public function setName(string $name): self
  84.     {
  85.         $this->name $name;
  86.         return $this;
  87.     }
  88.     public function getUsername(): ?string
  89.     {
  90.         return $this->username;
  91.     }
  92.     public function setUsername(string $username): self
  93.     {
  94.         $this->username $username;
  95.         return $this;
  96.     }
  97.     public function getPassword(): ?string
  98.     {
  99.         return $this->password;
  100.     }
  101.     public function setPassword(?string $password): self
  102.     {
  103.         $this->password $password;
  104.         return $this;
  105.     }
  106.     public function getHostname(): ?string
  107.     {
  108.         return $this->hostname;
  109.     }
  110.     public function setHostname(string $hostname): self
  111.     {
  112.         $this->hostname $hostname;
  113.         return $this;
  114.     }
  115.     public function getPort(): ?int
  116.     {
  117.         return $this->port;
  118.     }
  119.     public function setPort(int $port): self
  120.     {
  121.         $this->port $port;
  122.         return $this;
  123.     }
  124.     public function getNameFrom(): ?string
  125.     {
  126.         return $this->name_from;
  127.     }
  128.     public function setNameFrom(string $name_from): self
  129.     {
  130.         $this->name_from $name_from;
  131.         return $this;
  132.     }
  133.     public function getEmailFrom(): ?string
  134.     {
  135.         return $this->email_from;
  136.     }
  137.     public function setEmailFrom(string $email_from): self
  138.     {
  139.         $this->email_from $email_from;
  140.         return $this;
  141.     }
  142.     public function getEncryption(): ?string
  143.     {
  144.         return $this->encryption;
  145.     }
  146.     public function setEncryption(string $encryption): self
  147.     {
  148.         $this->encryption $encryption;
  149.         return $this;
  150.     }
  151.     public function getAuthMode(): ?string
  152.     {
  153.         return $this->auth_mode;
  154.     }
  155.     public function setAuthMode(string $auth_mode): self
  156.     {
  157.         $this->auth_mode $auth_mode;
  158.         return $this;
  159.     }
  160.     public function getIsDefault(): ?bool
  161.     {
  162.         return $this->is_default;
  163.     }
  164.     public function setIsDefault(bool $is_default): self
  165.     {
  166.         $this->is_default $is_default;
  167.         return $this;
  168.     }
  169.     public function getStatus(): ?bool
  170.     {
  171.         return $this->status;
  172.     }
  173.     public function setStatus(bool $status): self
  174.     {
  175.         $this->status $status;
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return Collection<int, NotificationQueue>
  180.      */
  181.     public function getEmailQueue(): Collection
  182.     {
  183.         return $this->email_queue;
  184.     }
  185.     public function addEmailQueue(NotificationQueue $emailQueue): self
  186.     {
  187.         if (!$this->email_queue->contains($emailQueue)) {
  188.             $this->email_queue[] = $emailQueue;
  189.             $emailQueue->setSmtp($this);
  190.         }
  191.         return $this;
  192.     }
  193.     public function removeEmailQueue(NotificationQueue $emailQueue): self
  194.     {
  195.         if ($this->email_queue->removeElement($emailQueue)) {
  196.             // set the owning side to null (unless already changed)
  197.             if ($emailQueue->getSmtp() === $this) {
  198.                 $emailQueue->setSmtp(null);
  199.             }
  200.         }
  201.         return $this;
  202.     }
  203.     public function getCustomer(): ?Customer
  204.     {
  205.         return $this->customer;
  206.     }
  207.     public function setCustomer(?Customer $customer): self
  208.     {
  209.         $this->customer $customer;
  210.         return $this;
  211.     }
  212. }