<?php
namespace App\Entity;
use App\Repository\CustomerPackageRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CustomerPackageRepository::class)]
class CustomerPackage
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?int $fieldLength = null;
#[ORM\Column]
private ?int $fieldWidth = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?PackageImage $packageImage = null;
#[ORM\OneToMany(
mappedBy: 'customerPackage',
targetEntity: 'App\Entity\CustomerAdvertisingAreaTierSettings',
cascade: ['persist', 'remove']
)]
private Collection $customerAdvertisingAreaTierSettings;
#[ORM\ManyToOne(targetEntity: Customer::class, cascade: ['persist'], inversedBy: 'packages')]
#[ORM\JoinColumn(nullable: true)]
private Customer $customer;
#[ORM\OneToMany(
mappedBy: 'customerPackage',
targetEntity: 'App\Entity\CustomerAdvertisingAreaTierPosition',
cascade: ['persist', 'remove']
)]
private Collection $customerAdvertisingAreaTierPosition;
#[ORM\Column(nullable: true)]
private ?string $colorFree = '#869859';
#[ORM\Column(nullable: true)]
private ?string $colorSold = '#9a3838';
#[ORM\Column(nullable: true)]
private ?string $colorReserved = '#686868';
#[ORM\Column(nullable: true)]
private ?string $colorBlocked = '#fdfdfd';
#[ORM\Column(nullable: true)]
private ?bool $draft = null;
public function __construct()
{
$this->customerAdvertisingAreaTierSettings = new ArrayCollection();
$this->customerAdvertisingAreaTierPosition = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPackageImage(): ?PackageImage
{
return $this->packageImage;
}
public function setPackageImage(?PackageImage $packageImage): self
{
$this->packageImage = $packageImage;
return $this;
}
/**
* @return Collection<int, CustomerAdvertisingAreaTierSettings>
*/
public function getCustomerAdvertisingAreaTierSettings(): Collection
{
return $this->customerAdvertisingAreaTierSettings;
}
public function addCustomerAdvertisingAreaTierSetting(
CustomerAdvertisingAreaTierSettings $customerAdvertisingAreaTierSetting
): self {
if (!$this->customerAdvertisingAreaTierSettings->contains($customerAdvertisingAreaTierSetting)) {
$this->customerAdvertisingAreaTierSettings->add($customerAdvertisingAreaTierSetting);
$customerAdvertisingAreaTierSetting->setCustomerPackage($this);
}
return $this;
}
public function removeCustomerAdvertisingAreaTierSetting(
CustomerAdvertisingAreaTierSettings $customerAdvertisingAreaTierSetting
): self {
if ($this->customerAdvertisingAreaTierSettings->removeElement($customerAdvertisingAreaTierSetting)) {
// set the owning side to null (unless already changed)
if ($customerAdvertisingAreaTierSetting->getCustomerPackage() === $this) {
$customerAdvertisingAreaTierSetting->setCustomerPackage(null);
}
}
return $this;
}
public function getCustomer(): ?Customer
{
return $this->customer;
}
public function setCustomer(?Customer $customer): self
{
$this->customer = $customer;
return $this;
}
/**
* @return Collection<int, CustomerAdvertisingAreaTierPosition>
*/
public function getCustomerAdvertisingAreaTierPosition(): Collection
{
return $this->customerAdvertisingAreaTierPosition;
}
public function addCustomerAdvertisingAreaTierPosition(
CustomerAdvertisingAreaTierPosition $customerAdvertisingAreaTierPosition
): self {
if (!$this->customerAdvertisingAreaTierPosition->contains($customerAdvertisingAreaTierPosition)) {
$this->customerAdvertisingAreaTierPosition->add($customerAdvertisingAreaTierPosition);
$customerAdvertisingAreaTierPosition->setCustomerPackage($this);
}
return $this;
}
public function removeCustomerAdvertisingAreaTierPosition(
CustomerAdvertisingAreaTierPosition $customerAdvertisingAreaTierPosition
): self {
if ($this->customerAdvertisingAreaTierPosition->removeElement($customerAdvertisingAreaTierPosition)) {
// set the owning side to null (unless already changed)
if ($customerAdvertisingAreaTierPosition->getCustomerPackage() === $this) {
$customerAdvertisingAreaTierPosition->setCustomerPackage(null);
}
}
return $this;
}
public function getColorFree(): ?string
{
return $this->colorFree;
}
public function setColorFree(string $colorFree): self
{
$this->colorFree = $colorFree;
return $this;
}
public function getColorSold(): ?string
{
return $this->colorSold;
}
public function setColorSold(string $colorSold): self
{
$this->colorSold = $colorSold;
return $this;
}
public function getColorReserved(): ?string
{
return $this->colorReserved;
}
public function setColorReserved(string $colorReserved): self
{
$this->colorReserved = $colorReserved;
return $this;
}
public function getColorBlocked(): ?string
{
return $this->colorBlocked;
}
public function setColorBlocked(string $colorBlocked): self
{
$this->colorBlocked = $colorBlocked;
return $this;
}
public function isDraft(): ?bool
{
return $this->draft;
}
public function setDraft(?bool $draft): self
{
$this->draft = $draft;
return $this;
}
public function getFieldLength(): ?int
{
return $this->fieldLength;
}
public function setFieldLength(int $fieldLength): self
{
$this->fieldLength = $fieldLength;
return $this;
}
public function getFieldWidth(): ?int
{
return $this->fieldWidth;
}
public function setFieldWidth(int $fieldWidth): self
{
$this->fieldWidth = $fieldWidth;
return $this;
}
}