<?php
namespace App\Entity;
use App\Repository\CustomerAdvertisingAreaRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: CustomerAdvertisingAreaRepository::class)]
class CustomerAdvertisingArea
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: 'uuid', unique: true)]
private ?string $uuid;
#[ORM\Column(type: 'string', length: 255)]
private ?string $name = null;
#[ORM\Column(type: 'integer', length: 11)]
private ?int $sortingIndex = null;
#[ORM\Column(type: 'float', length: 11)]
private ?float $price = null;
#[ORM\Column]
private ?float $setupPriceUnit = null;
#[ORM\Column]
private bool $withinSetupPrice = true;
#[ORM\Column(nullable: true)]
private ?int $minDuration = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Customer', cascade: ['persist'])]
#[ORM\JoinColumn(name: 'fk_customer', nullable: false)]
private ?Customer $customer = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\AdvertisingAreaTier', fetch: 'EAGER')]
#[ORM\JoinColumn(name: 'fk_advertising_area_tier', nullable: false)]
private ?AdvertisingAreaTier $advertisingAreaTier = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\AdvertisingAreaTierPosition', fetch: 'EAGER')]
#[ORM\JoinColumn(name: 'fk_advertising_area_tier_position', nullable: false)]
private ?AdvertisingAreaTierPosition $advertisingAreaTierPosition = null;
#[ORM\ManyToOne(
targetEntity: 'App\Entity\CustomerAdvertisingAreaTierPosition',
cascade: ['persist'],
inversedBy: 'customerAdvertisingAreas'
)]
#[ORM\JoinColumn(name: 'fk_customer_advertising_area_tier_position', nullable: false)]
private ?CustomerAdvertisingAreaTierPosition $customerAdvertisingAreaTierPosition;
#[ORM\ManyToOne(targetEntity: 'App\Entity\CustomerAdvertisingAreaTierSettings', cascade: ['persist'])]
#[ORM\JoinColumn(name: 'fk_advertising_area_tier_settings', nullable: false)]
private ?CustomerAdvertisingAreaTierSettings $settings;
#[ORM\ManyToOne(targetEntity: AdvertisingAreaStatus::class)]
#[ORM\JoinColumn(name: 'fk_advertising_area_status', nullable: false)]
private AdvertisingAreaStatus $status;
#[ORM\ManyToOne(cascade: ['persist'], inversedBy: 'areas')]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
private ?Sponsor $sponsor = null;
#[ORM\ManyToOne(targetEntity: Contract::class, cascade: ['persist', 'remove'], inversedBy: 'areas')]
#[ORM\JoinColumn(name: 'fk_contract', nullable: true)]
private ?Contract $contract = null;
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 getSortingIndex(): ?int
{
return $this->sortingIndex;
}
public function setSortingIndex(int $sortingIndex): self
{
$this->sortingIndex = $sortingIndex;
return $this;
}
public function getCustomer(): ?Customer
{
return $this->customer;
}
public function setCustomer(?Customer $customer): self
{
$this->customer = $customer;
return $this;
}
public function getCustomerAdvertisingAreaTierPosition(): ?CustomerAdvertisingAreaTierPosition
{
return $this->customerAdvertisingAreaTierPosition;
}
public function setCustomerAdvertisingAreaTierPosition(
?CustomerAdvertisingAreaTierPosition $customerAdvertisingAreaTierPosition
): self {
$this->customerAdvertisingAreaTierPosition = $customerAdvertisingAreaTierPosition;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
public function getSettings(): ?CustomerAdvertisingAreaTierSettings
{
return $this->settings;
}
public function setSettings(
?CustomerAdvertisingAreaTierSettings $customerAdvertisingAreaTierSettings
): self {
$this->settings = $customerAdvertisingAreaTierSettings;
return $this;
}
public function getSponsor(): ?Sponsor
{
return $this->sponsor;
}
public function setSponsor(?Sponsor $sponsor): self
{
$this->sponsor = $sponsor;
return $this;
}
public function getContract(): ?Contract
{
return $this->contract;
}
public function setContract(?Contract $contract): self
{
$this->contract = $contract;
return $this;
}
public function getStatus(): ?AdvertisingAreaStatus
{
return $this->status;
}
public function setStatus(?AdvertisingAreaStatus $status): self
{
$this->status = $status;
return $this;
}
public function getMinDuration(): ?int
{
return $this->minDuration;
}
public function setMinDuration(?int $minDuration): self
{
$this->minDuration = $minDuration;
return $this;
}
public function getSetupPriceUnit(): ?float
{
return $this->setupPriceUnit;
}
public function setSetupPriceUnit(float $setupPriceUnit): self
{
$this->setupPriceUnit = $setupPriceUnit;
return $this;
}
public function getUuid()
{
return $this->uuid;
}
public function setUuid($uuid): self
{
$this->uuid = $uuid;
return $this;
}
public function isWithinSetupPrice(): ?bool
{
return $this->withinSetupPrice;
}
public function setWithinSetupPrice(bool $withinSetupPrice): self
{
$this->withinSetupPrice = $withinSetupPrice;
return $this;
}
public function getAdvertisingAreaTier(): ?AdvertisingAreaTier
{
return $this->advertisingAreaTier;
}
public function setAdvertisingAreaTier(?AdvertisingAreaTier $advertisingAreaTier): self
{
$this->advertisingAreaTier = $advertisingAreaTier;
return $this;
}
public function getAdvertisingAreaTierPosition(): ?AdvertisingAreaTierPosition
{
return $this->advertisingAreaTierPosition;
}
public function setAdvertisingAreaTierPosition(?AdvertisingAreaTierPosition $advertisingAreaTierPosition): self
{
$this->advertisingAreaTierPosition = $advertisingAreaTierPosition;
return $this;
}
}