<?php
namespace JanusHercules\ExtendedApplicationQuestionnaire\Domain\Entity;
use App\Entity\RecurrentJob;
use App\Utility\DatabaseIdGenerator;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
#[ORM\Table(
name: 'extended_application_customer_question_template_negation_entries'
)]
class QuestionTemplateNegationEntry
{
public function __construct(
ExtendedApplicationCustomerQuestionTemplate $template,
RecurrentJob $recurrentJob
) {
$this->extendedApplicationCustomerQuestionTemplate = $template;
$this->recurrentJob = $recurrentJob;
}
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: DatabaseIdGenerator::class)]
#[ORM\Column(
type: Types::GUID,
unique: true
)]
private ?string $id = null;
public function getId(): ?string
{
return $this->id;
}
#[ORM\ManyToOne(
targetEntity: ExtendedApplicationCustomerQuestionTemplate::class,
cascade: ['persist'],
inversedBy: 'questionTemplateNegationEntries'
)]
#[ORM\JoinColumn(
name: 'extended_application_customer_question_templates_id',
referencedColumnName: 'id',
nullable: false,
onDelete: 'CASCADE'
)]
private ExtendedApplicationCustomerQuestionTemplate $extendedApplicationCustomerQuestionTemplate;
public function getExtendedApplicationCustomerQuestionTemplate(): ExtendedApplicationCustomerQuestionTemplate
{
return $this->extendedApplicationCustomerQuestionTemplate;
}
public function setExtendedApplicationCustomerQuestionTemplate(ExtendedApplicationCustomerQuestionTemplate $template): void
{
$this->extendedApplicationCustomerQuestionTemplate = $template;
}
#[ORM\ManyToOne(
targetEntity: RecurrentJob::class,
cascade: ['persist']
)]
#[ORM\JoinColumn(
name: 'recurrent_jobs_id',
referencedColumnName: 'id',
nullable: false,
onDelete: 'CASCADE'
)]
private RecurrentJob $recurrentJob;
public function getRecurrentJob(): RecurrentJob
{
return $this->recurrentJob;
}
public function setRecurrentJob(RecurrentJob $recurrentJob): void
{
$this->recurrentJob = $recurrentJob;
}
}