<?php
namespace App\Entity;
use App\Repository\AdvertisingAreaTierRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AdvertisingAreaTierRepository::class)]
class AdvertisingAreaTier
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(length: 255)]
private ?string $identifier = null;
#[ORM\OneToMany(mappedBy: 'advertisingAreaTier', targetEntity: AdvertisingAreaTierPosition::class)]
private Collection $advertisingAreaTierPositions;
public function __construct()
{
$this->advertisingAreaTierPositions = 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 getIdentifier(): ?string
{
return $this->identifier;
}
public function setIdentifier(string $identifier): self
{
$this->identifier = $identifier;
return $this;
}
/**
* @return Collection<int, AdvertisingAreaTierPosition>
*/
public function getAdvertisingAreaTierPositions(): Collection
{
return $this->advertisingAreaTierPositions;
}
public function addAdvertisingAreaTierPosition(AdvertisingAreaTierPosition $advertisingAreaTierPosition): self
{
if (!$this->advertisingAreaTierPositions->contains($advertisingAreaTierPosition)) {
$this->advertisingAreaTierPositions->add($advertisingAreaTierPosition);
$advertisingAreaTierPosition->setAdvertisingAreaTier($this);
}
return $this;
}
public function removeAdvertisingAreaTierPosition(AdvertisingAreaTierPosition $advertisingAreaTierPosition): self
{
if ($this->advertisingAreaTierPositions->removeElement($advertisingAreaTierPosition)) {
// set the owning side to null (unless already changed)
if ($advertisingAreaTierPosition->getAdvertisingAreaTier() === $this) {
$advertisingAreaTierPosition->setAdvertisingAreaTier(null);
}
}
return $this;
}
}