src/JanusHercules/ExtendedApplicationQuestionnaire/Domain/Entity/QuestionTemplateNegationEntry.php line 14

Open in your IDE?
  1. <?php
  2. namespace JanusHercules\ExtendedApplicationQuestionnaire\Domain\Entity;
  3. use App\Entity\RecurrentJob;
  4. use App\Utility\DatabaseIdGenerator;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity]
  8. #[ORM\Table(
  9. name: 'extended_application_customer_question_template_negation_entries'
  10. )]
  11. class QuestionTemplateNegationEntry
  12. {
  13. public function __construct(
  14. ExtendedApplicationCustomerQuestionTemplate $template,
  15. RecurrentJob $recurrentJob
  16. ) {
  17. $this->extendedApplicationCustomerQuestionTemplate = $template;
  18. $this->recurrentJob = $recurrentJob;
  19. }
  20. #[ORM\Id]
  21. #[ORM\GeneratedValue(strategy: 'CUSTOM')]
  22. #[ORM\CustomIdGenerator(class: DatabaseIdGenerator::class)]
  23. #[ORM\Column(
  24. type: Types::GUID,
  25. unique: true
  26. )]
  27. private ?string $id = null;
  28. public function getId(): ?string
  29. {
  30. return $this->id;
  31. }
  32. #[ORM\ManyToOne(
  33. targetEntity: ExtendedApplicationCustomerQuestionTemplate::class,
  34. cascade: ['persist'],
  35. inversedBy: 'questionTemplateNegationEntries'
  36. )]
  37. #[ORM\JoinColumn(
  38. name: 'extended_application_customer_question_templates_id',
  39. referencedColumnName: 'id',
  40. nullable: false,
  41. onDelete: 'CASCADE'
  42. )]
  43. private ExtendedApplicationCustomerQuestionTemplate $extendedApplicationCustomerQuestionTemplate;
  44. public function getExtendedApplicationCustomerQuestionTemplate(): ExtendedApplicationCustomerQuestionTemplate
  45. {
  46. return $this->extendedApplicationCustomerQuestionTemplate;
  47. }
  48. public function setExtendedApplicationCustomerQuestionTemplate(ExtendedApplicationCustomerQuestionTemplate $template): void
  49. {
  50. $this->extendedApplicationCustomerQuestionTemplate = $template;
  51. }
  52. #[ORM\ManyToOne(
  53. targetEntity: RecurrentJob::class,
  54. cascade: ['persist']
  55. )]
  56. #[ORM\JoinColumn(
  57. name: 'recurrent_jobs_id',
  58. referencedColumnName: 'id',
  59. nullable: false,
  60. onDelete: 'CASCADE'
  61. )]
  62. private RecurrentJob $recurrentJob;
  63. public function getRecurrentJob(): RecurrentJob
  64. {
  65. return $this->recurrentJob;
  66. }
  67. public function setRecurrentJob(RecurrentJob $recurrentJob): void
  68. {
  69. $this->recurrentJob = $recurrentJob;
  70. }
  71. }