<?php
namespace App\Entity\BC;
use App\Repository\BC\PositionTypeRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PositionTypeRepository::class)]
#[ORM\HasLifecycleCallbacks]
class PositionType
{
#[ORM\Id]
#[ORM\Column(type: 'string', length: 64)]
private string $id;
#[ORM\ManyToOne(targetEntity: ProcessType::class, inversedBy: 'positionTypes')]
#[ORM\JoinColumn(name: 'process_type_id', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
private ProcessType $processType;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $description = null;
#[ORM\Column(type: 'string', length: 64, nullable: true)]
private ?string $contractPeriod = null;
#[ORM\Column(type: 'string', length: 64, nullable: true)]
private ?string $noOfEditions = null;
#[ORM\Column(type: 'string', length: 64, nullable: true)]
private ?string $customerPriceGroup = null;
#[ORM\Column(type: 'boolean', options: ['default' => false])]
private bool $isAdditionalService = false;
#[ORM\Column(type: 'boolean', options: ['default' => false])]
private bool $testSubscription = false;
#[ORM\Column(type: 'datetime_immutable')]
private \DateTimeImmutable $createdAt;
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
private \DateTimeImmutable $updatedAt;
public function __construct(string $id, ProcessType $processType)
{
$this->id = $id;
$this->processType = $processType;
}
#[ORM\PrePersist]
public function onPrePersist(): void
{
$now = new \DateTimeImmutable();
$this->createdAt = $now;
}
#[ORM\PreUpdate]
public function onPreUpdate(): void
{
$this->updatedAt = new \DateTimeImmutable();
}
public function getId(): string
{
return $this->id;
}
public function getProcessType(): ProcessType
{
return $this->processType;
}
public function setProcessType(ProcessType $processType): void
{
$this->processType = $processType;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): void
{
$this->description = $description;
}
public function getContractPeriod(): ?string
{
return $this->contractPeriod;
}
public function setContractPeriod(?string $contractPeriod): void
{
$this->contractPeriod = $contractPeriod;
}
public function getNoOfEditions(): ?string
{
return $this->noOfEditions;
}
public function setNoOfEditions(?string $noOfEditions): void
{
$this->noOfEditions = $noOfEditions;
}
public function getCustomerPriceGroup(): ?string
{
return $this->customerPriceGroup;
}
public function setCustomerPriceGroup(?string $customerPriceGroup): void
{
$this->customerPriceGroup = $customerPriceGroup;
}
public function isAdditionalService(): bool
{
return $this->isAdditionalService;
}
public function setIsAdditionalService(bool $flag): void
{
$this->isAdditionalService = $flag;
}
public function isTestSubscription(): bool
{
return $this->testSubscription;
}
public function setTestSubscription(bool $flag): void
{
$this->testSubscription = $flag;
}
public function getCreatedAt(): \DateTimeImmutable
{
return $this->createdAt;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
}