src/Entity/AdvertisingAreaTier.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AdvertisingAreaTierRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassAdvertisingAreaTierRepository::class)]
  8. class AdvertisingAreaTier
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $identifier null;
  18.     #[ORM\OneToMany(mappedBy'advertisingAreaTier'targetEntityAdvertisingAreaTierPosition::class)]
  19.     private Collection $advertisingAreaTierPositions;
  20.     public function __construct()
  21.     {
  22.         $this->advertisingAreaTierPositions = new ArrayCollection();
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getName(): ?string
  29.     {
  30.         return $this->name;
  31.     }
  32.     public function setName(string $name): self
  33.     {
  34.         $this->name $name;
  35.         return $this;
  36.     }
  37.     public function getIdentifier(): ?string
  38.     {
  39.         return $this->identifier;
  40.     }
  41.     public function setIdentifier(string $identifier): self
  42.     {
  43.         $this->identifier $identifier;
  44.         return $this;
  45.     }
  46.     /**
  47.      * @return Collection<int, AdvertisingAreaTierPosition>
  48.      */
  49.     public function getAdvertisingAreaTierPositions(): Collection
  50.     {
  51.         return $this->advertisingAreaTierPositions;
  52.     }
  53.     public function addAdvertisingAreaTierPosition(AdvertisingAreaTierPosition $advertisingAreaTierPosition): self
  54.     {
  55.         if (!$this->advertisingAreaTierPositions->contains($advertisingAreaTierPosition)) {
  56.             $this->advertisingAreaTierPositions->add($advertisingAreaTierPosition);
  57.             $advertisingAreaTierPosition->setAdvertisingAreaTier($this);
  58.         }
  59.         return $this;
  60.     }
  61.     public function removeAdvertisingAreaTierPosition(AdvertisingAreaTierPosition $advertisingAreaTierPosition): self
  62.     {
  63.         if ($this->advertisingAreaTierPositions->removeElement($advertisingAreaTierPosition)) {
  64.             // set the owning side to null (unless already changed)
  65.             if ($advertisingAreaTierPosition->getAdvertisingAreaTier() === $this) {
  66.                 $advertisingAreaTierPosition->setAdvertisingAreaTier(null);
  67.             }
  68.         }
  69.         return $this;
  70.     }
  71. }