<?phpnamespace App\Entity;use App\Repository\MailjetApiRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: MailjetApiRepository::class)]class MailjetApi{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255)] private $name; #[ORM\Column(type: 'string', length: 300)] private $username; #[ORM\Column(type: 'string', length: 300)] private $password; #[ORM\OneToMany(targetEntity: Parameters::class, mappedBy: 'mailjetapi')] private $parameters; #[ORM\OneToMany(targetEntity: Parameters::class, mappedBy: 'mailjetapiRecrutement')] private $parametersRecrutement; #[ORM\ManyToOne(inversedBy: 'mailjetApis')] private ?MailjetApiType $type = null; #[ORM\OneToMany(mappedBy: 'mailing_api', targetEntity: AccountingFirm::class)] private Collection $accountingFirms; private $encryptionKey; #[ORM\OneToMany(mappedBy: 'emailingClientApi', targetEntity: AccountingFirm::class)] private $accountingFirmsEmailingClient; public function __construct() { $this->parameters = new ArrayCollection(); $this->accountingFirms = new ArrayCollection(); $this->encryptionKey = base64_decode($_ENV['ENCRYPTION_KEY']); $this->accountingFirmsEmailingClient = 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; } /** * @return Collection|Parameters[] */ public function getParameters(): Collection { return $this->parameters; } public function addParameter(Parameters $parameter): self { if (!$this->parameters->contains($parameter)) { $this->parameters[] = $parameter; $parameter->setMailjetapi($this); } return $this; } public function removeParameter(Parameters $parameter): self { if ($this->parameters->removeElement($parameter)) { // set the owning side to null (unless already changed) if ($parameter->getMailjetapi() === $this) { $parameter->setMailjetapi(null); } } return $this; } public function getType(): ?MailjetApiType { return $this->type; } public function setType(?MailjetApiType $type): self { $this->type = $type; return $this; } /** * @return Collection<int, AccountingFirm> */ public function getAccountingFirms(): Collection { return $this->accountingFirms; } public function addAccountingFirm(AccountingFirm $accountingFirm): self { if (!$this->accountingFirms->contains($accountingFirm)) { $this->accountingFirms->add($accountingFirm); $accountingFirm->setMailingApi($this); } return $this; } public function removeAccountingFirm(AccountingFirm $accountingFirm): self { if ($this->accountingFirms->removeElement($accountingFirm)) { // set the owning side to null (unless already changed) if ($accountingFirm->getMailingApi() === $this) { $accountingFirm->setMailingApi(null); } } return $this; } /** * @return Collection|Parameters[] */ public function getParametersRecrutement(): Collection { return $this->parametersRecrutement; } public function addParameterRecrutement(Parameters $parameterRecrutement): self { if (!$this->parametersRecrutement->contains($parameterRecrutement)) { $this->parametersRecrutement[] = $parameterRecrutement; $parameterRecrutement->setMailjetapiRecrutement($this); } return $this; } public function removeParameterRecrutement(Parameters $parameterRecrutement): self { if ($this->parametersRecrutement->removeElement($parameterRecrutement)) { // set the owning side to null (unless already changed) if ($parameterRecrutement->getMailjetapiRecrutement() === $this) { $parameterRecrutement->setMailjetapiRecrutement(null); } } return $this; } /** * @return Collection<int, AccountingFirm> */ public function getAccountingFirmsEmailingClient(): Collection { return $this->accountingFirmsEmailingClient; } public function addAccountingFirmsEmailingClient(AccountingFirm $accountingFirmsEmailingClient): self { if (!$this->accountingFirmsEmailingClient->contains($accountingFirmsEmailingClient)) { $this->accountingFirmsEmailingClient[] = $accountingFirmsEmailingClient; $accountingFirmsEmailingClient->setEmailingClientApi($this); } return $this; } public function removeAccountingFirmsEmailingClient(AccountingFirm $accountingFirmsEmailingClient): self { if ($this->accountingFirmsEmailingClient->removeElement($accountingFirmsEmailingClient)) { // set the owning side to null (unless already changed) if ($accountingFirmsEmailingClient->getEmailingClientApi() === $this) { $accountingFirmsEmailingClient->setEmailingClientApi(null); } } return $this; }}