<?php
namespace App\Entity;
use App\Repository\MailjetApiTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: MailjetApiTypeRepository::class)]
class MailjetApiType
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\OneToMany(mappedBy: 'type', targetEntity: MailjetApi::class)]
private Collection $mailjetApis;
public function __construct()
{
$this->mailjetApis = 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;
}
/**
* @return Collection<int, MailjetApi>
*/
public function getMailjetApis(): Collection
{
return $this->mailjetApis;
}
public function addMailjetApi(MailjetApi $mailjetApi): self
{
if (!$this->mailjetApis->contains($mailjetApi)) {
$this->mailjetApis->add($mailjetApi);
$mailjetApi->setType($this);
}
return $this;
}
public function removeMailjetApi(MailjetApi $mailjetApi): self
{
if ($this->mailjetApis->removeElement($mailjetApi)) {
// set the owning side to null (unless already changed)
if ($mailjetApi->getType() === $this) {
$mailjetApi->setType(null);
}
}
return $this;
}
}