src/Entity/Webmail/Account.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Webmail;
  3. use App\Entity\Section;
  4. use App\Repository\Webmail\AccountRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassAccountRepository::class)]
  9. #[ORM\Table('webmail_account')]
  10. class Account
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $email null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $login null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $host null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $password null;
  24.     #[ORM\ManyToOne(inversedBy'webmailAccounts')]
  25.     private ?Section $section null;
  26.     #[ORM\OneToMany(mappedBy'account'targetEntityAccountAccess::class)]
  27.     private Collection $accountAccesses;
  28.     #[ORM\Column(length255)]
  29.     private ?string $smtpLogin null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $smtpHost null;
  32.     #[ORM\Column(length255)]
  33.     private ?string $smtpPassword null;
  34.     public function __construct()
  35.     {
  36.         $this->accountAccesses = new ArrayCollection();
  37.     }
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getEmail(): ?string
  43.     {
  44.         return $this->email;
  45.     }
  46.     public function setEmail(string $email): self
  47.     {
  48.         $this->email $email;
  49.         return $this;
  50.     }
  51.     public function getLogin(): ?string
  52.     {
  53.         return $this->login;
  54.     }
  55.     public function setLogin(string $login): self
  56.     {
  57.         $this->login $login;
  58.         return $this;
  59.     }
  60.     public function getHost(): ?string
  61.     {
  62.         return $this->host;
  63.     }
  64.     public function setHost(string $host): self
  65.     {
  66.         $this->host $host;
  67.         return $this;
  68.     }
  69.     public function getPassword(): ?string
  70.     {
  71.         return $this->password;
  72.     }
  73.     public function setPassword(string $password): self
  74.     {
  75.         $this->password $password;
  76.         return $this;
  77.     }
  78.     public function getSection(): ?Section
  79.     {
  80.         return $this->section;
  81.     }
  82.     public function setSection(?Section $section): self
  83.     {
  84.         $this->section $section;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection<int, AccountAccess>
  89.      */
  90.     public function getAccountAccesses(): Collection
  91.     {
  92.         return $this->accountAccesses;
  93.     }
  94.     public function addAccountAccess(AccountAccess $accountAccess): self
  95.     {
  96.         if (!$this->accountAccesses->contains($accountAccess)) {
  97.             $this->accountAccesses->add($accountAccess);
  98.             $accountAccess->setAccount($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removeAccountAccess(AccountAccess $accountAccess): self
  103.     {
  104.         if ($this->accountAccesses->removeElement($accountAccess)) {
  105.             // set the owning side to null (unless already changed)
  106.             if ($accountAccess->getAccount() === $this) {
  107.                 $accountAccess->setAccount(null);
  108.             }
  109.         }
  110.         return $this;
  111.     }
  112.     public function getSmtpLogin(): ?string
  113.     {
  114.         return $this->smtpLogin;
  115.     }
  116.     public function setSmtpLogin(string $smtpLogin): self
  117.     {
  118.         $this->smtpLogin $smtpLogin;
  119.         return $this;
  120.     }
  121.     public function getSmtpHost(): ?string
  122.     {
  123.         return $this->smtpHost;
  124.     }
  125.     public function setSmtpHost(string $smtpHost): self
  126.     {
  127.         $this->smtpHost $smtpHost;
  128.         return $this;
  129.     }
  130.     public function getSmtpPassword(): ?string
  131.     {
  132.         return $this->smtpPassword;
  133.     }
  134.     public function setSmtpPassword(string $smtpPassword): self
  135.     {
  136.         $this->smtpPassword $smtpPassword;
  137.         return $this;
  138.     }
  139. }