src/Entity/CustomerAdvertisingAreaTierPosition.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CustomerAdvertisingAreaTierPositionRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCustomerAdvertisingAreaTierPositionRepository::class)]
  8. class CustomerAdvertisingAreaTierPosition
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\ManyToOne(targetEntity'App\Entity\Customer')]
  15.     #[ORM\JoinColumn(name'fk_customer'nullablefalse)]
  16.     private Customer $customer;
  17.     #[ORM\ManyToOne(targetEntity'App\Entity\CustomerPackage'inversedBy'customerAdvertisingAreaTierPosition')]
  18.     #[ORM\JoinColumn(name'fk_customer_package'nullablefalse)]
  19.     private CustomerPackage $customerPackage;
  20.     #[ORM\ManyToOne(targetEntity'App\Entity\AdvertisingAreaTier')]
  21.     #[ORM\JoinColumn(name'fk_advertising_area_tier'nullablefalse)]
  22.     private AdvertisingAreaTier $advertisingAreaTier;
  23.     #[ORM\ManyToOne(targetEntity'App\Entity\AdvertisingAreaTierPosition')]
  24.     #[ORM\JoinColumn(name'fk_advertising_area_tier_position'nullablefalse)]
  25.     private AdvertisingAreaTierPosition $advertisingAreaTierPosition;
  26.     #[ORM\OneToMany(
  27.         mappedBy'customerAdvertisingAreaTierPosition',
  28.         targetEntityCustomerAdvertisingArea::class,
  29.         cascade: ['persist''remove']
  30.     )]
  31.     private Collection $customerAdvertisingAreas;
  32.     public function __construct()
  33.     {
  34.         $this->customerAdvertisingAreas = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getCustomer(): ?Customer
  41.     {
  42.         return $this->customer;
  43.     }
  44.     public function setCustomer(?Customer $customer): self
  45.     {
  46.         $this->customer $customer;
  47.         return $this;
  48.     }
  49.     public function getCustomerPackage(): ?CustomerPackage
  50.     {
  51.         return $this->customerPackage;
  52.     }
  53.     public function setCustomerPackage(?CustomerPackage $customerPackage): self
  54.     {
  55.         $this->customerPackage $customerPackage;
  56.         return $this;
  57.     }
  58.     public function getAdvertisingAreaTier(): ?AdvertisingAreaTier
  59.     {
  60.         return $this->advertisingAreaTier;
  61.     }
  62.     public function setAdvertisingAreaTier(?AdvertisingAreaTier $advertisingAreaTier): self
  63.     {
  64.         $this->advertisingAreaTier $advertisingAreaTier;
  65.         return $this;
  66.     }
  67.     public function getAdvertisingAreaTierPosition(): ?AdvertisingAreaTierPosition
  68.     {
  69.         return $this->advertisingAreaTierPosition;
  70.     }
  71.     public function setAdvertisingAreaTierPosition(?AdvertisingAreaTierPosition $advertisingAreaTierPosition): self
  72.     {
  73.         $this->advertisingAreaTierPosition $advertisingAreaTierPosition;
  74.         return $this;
  75.     }
  76.     /**
  77.      * @return Collection<int, CustomerAdvertisingArea>
  78.      */
  79.     public function getCustomerAdvertisingAreas(): Collection
  80.     {
  81.         return $this->customerAdvertisingAreas;
  82.     }
  83.     public function addCustomerAdvertisingArea(CustomerAdvertisingArea $customerAdvertisingArea): self
  84.     {
  85.         if (!$this->customerAdvertisingAreas->contains($customerAdvertisingArea)) {
  86.             $this->customerAdvertisingAreas->add($customerAdvertisingArea);
  87.             $customerAdvertisingArea->setCustomerAdvertisingAreaTierPosition($this);
  88.         }
  89.         return $this;
  90.     }
  91.     public function removeCustomerAdvertisingArea(CustomerAdvertisingArea $customerAdvertisingArea): self
  92.     {
  93.         if ($this->customerAdvertisingAreas->removeElement($customerAdvertisingArea)) {
  94.             // set the owning side to null (unless already changed)
  95.             if ($customerAdvertisingArea->getCustomerAdvertisingAreaTierPosition() === $this) {
  96.                 $customerAdvertisingArea->setCustomerAdvertisingAreaTierPosition(null);
  97.             }
  98.         }
  99.         return $this;
  100.     }
  101. }