src/Entity/MailjetApi.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MailjetApiRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassMailjetApiRepository::class)]
  8. class MailjetApi
  9. {
  10.   #[ORM\Id]
  11.   #[ORM\GeneratedValue]
  12.   #[ORM\Column(type'integer')]
  13.   private $id;
  14.   #[ORM\Column(type'string'length255)]
  15.   private $name;
  16.   #[ORM\Column(type'string'length300)]
  17.   private $username;
  18.   #[ORM\Column(type'string'length300)]
  19.   private $password;
  20.   #[ORM\OneToMany(targetEntityParameters::class, mappedBy'mailjetapi')]
  21.   private $parameters;
  22.   #[ORM\OneToMany(targetEntityParameters::class, mappedBy'mailjetapiRecrutement')]
  23.   private $parametersRecrutement;
  24.   #[ORM\ManyToOne(inversedBy'mailjetApis')]
  25.   private ?MailjetApiType $type null;
  26.   #[ORM\OneToMany(mappedBy'mailing_api'targetEntityAccountingFirm::class)]
  27.   private Collection $accountingFirms;
  28.   private $encryptionKey;
  29.   #[ORM\OneToMany(mappedBy'emailingClientApi'targetEntityAccountingFirm::class)]
  30.   private $accountingFirmsEmailingClient;
  31.   public function __construct()
  32.   {
  33.     $this->parameters = new ArrayCollection();
  34.     $this->accountingFirms = new ArrayCollection();
  35.     $this->encryptionKey base64_decode($_ENV['ENCRYPTION_KEY']);
  36.     $this->accountingFirmsEmailingClient = new ArrayCollection();
  37.   }
  38.   public function getId(): ?int
  39.   {
  40.     return $this->id;
  41.   }
  42.   public function getName(): ?string
  43.   {
  44.     return $this->name;
  45.   }
  46.   public function setName(string $name): self
  47.   {
  48.     $this->name $name;
  49.     return $this;
  50.   }
  51.   public function getUsername(): ?string
  52.   {
  53.     return $this->username;
  54.   }
  55.   public function setUsername(string $username): self
  56.   {
  57.     $this->username $username;
  58.     return $this;
  59.   }
  60.   public function getPassword(): ?string
  61.   {
  62.     return $this->password;
  63.   }
  64.   public function setPassword(string $password): self
  65.   {
  66.     $this->password $password;
  67.     return $this;
  68.   }
  69.   /**
  70.    * @return Collection|Parameters[]
  71.    */
  72.   public function getParameters(): Collection
  73.   {
  74.     return $this->parameters;
  75.   }
  76.   public function addParameter(Parameters $parameter): self
  77.   {
  78.     if (!$this->parameters->contains($parameter)) {
  79.       $this->parameters[] = $parameter;
  80.       $parameter->setMailjetapi($this);
  81.     }
  82.     return $this;
  83.   }
  84.   public function removeParameter(Parameters $parameter): self
  85.   {
  86.     if ($this->parameters->removeElement($parameter)) {
  87.       // set the owning side to null (unless already changed)
  88.       if ($parameter->getMailjetapi() === $this) {
  89.         $parameter->setMailjetapi(null);
  90.       }
  91.     }
  92.     return $this;
  93.   }
  94.   public function getType(): ?MailjetApiType
  95.   {
  96.     return $this->type;
  97.   }
  98.   public function setType(?MailjetApiType $type): self
  99.   {
  100.     $this->type $type;
  101.     return $this;
  102.   }
  103.   /**
  104.    * @return Collection<int, AccountingFirm>
  105.    */
  106.   public function getAccountingFirms(): Collection
  107.   {
  108.     return $this->accountingFirms;
  109.   }
  110.   public function addAccountingFirm(AccountingFirm $accountingFirm): self
  111.   {
  112.     if (!$this->accountingFirms->contains($accountingFirm)) {
  113.       $this->accountingFirms->add($accountingFirm);
  114.       $accountingFirm->setMailingApi($this);
  115.     }
  116.     return $this;
  117.   }
  118.   public function removeAccountingFirm(AccountingFirm $accountingFirm): self
  119.   {
  120.     if ($this->accountingFirms->removeElement($accountingFirm)) {
  121.       // set the owning side to null (unless already changed)
  122.       if ($accountingFirm->getMailingApi() === $this) {
  123.         $accountingFirm->setMailingApi(null);
  124.       }
  125.     }
  126.     return $this;
  127.   }
  128.   /**
  129.    * @return Collection|Parameters[]
  130.    */
  131.   public function getParametersRecrutement(): Collection
  132.   {
  133.     return $this->parametersRecrutement;
  134.   }
  135.   public function addParameterRecrutement(Parameters $parameterRecrutement): self
  136.   {
  137.     if (!$this->parametersRecrutement->contains($parameterRecrutement)) {
  138.       $this->parametersRecrutement[] = $parameterRecrutement;
  139.       $parameterRecrutement->setMailjetapiRecrutement($this);
  140.     }
  141.     return $this;
  142.   }
  143.   public function removeParameterRecrutement(Parameters $parameterRecrutement): self
  144.   {
  145.     if ($this->parametersRecrutement->removeElement($parameterRecrutement)) {
  146.       // set the owning side to null (unless already changed)
  147.       if ($parameterRecrutement->getMailjetapiRecrutement() === $this) {
  148.         $parameterRecrutement->setMailjetapiRecrutement(null);
  149.       }
  150.     }
  151.     return $this;
  152.   }
  153.   /**
  154.    * @return Collection<int, AccountingFirm>
  155.    */
  156.   public function getAccountingFirmsEmailingClient(): Collection
  157.   {
  158.       return $this->accountingFirmsEmailingClient;
  159.   }
  160.   public function addAccountingFirmsEmailingClient(AccountingFirm $accountingFirmsEmailingClient): self
  161.   {
  162.       if (!$this->accountingFirmsEmailingClient->contains($accountingFirmsEmailingClient)) {
  163.           $this->accountingFirmsEmailingClient[] = $accountingFirmsEmailingClient;
  164.           $accountingFirmsEmailingClient->setEmailingClientApi($this);
  165.       }
  166.       return $this;
  167.   }
  168.   public function removeAccountingFirmsEmailingClient(AccountingFirm $accountingFirmsEmailingClient): self
  169.   {
  170.       if ($this->accountingFirmsEmailingClient->removeElement($accountingFirmsEmailingClient)) {
  171.           // set the owning side to null (unless already changed)
  172.           if ($accountingFirmsEmailingClient->getEmailingClientApi() === $this) {
  173.               $accountingFirmsEmailingClient->setEmailingClientApi(null);
  174.           }
  175.       }
  176.       return $this;
  177.   }
  178. }