src/Entity/Channel/Certificate/CursusStartCertificate.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Channel\Certificate;
  3. use App\Entity\Channel\Organization;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. #[
  8. ORM\Entity(),
  9. ORM\Table(name: 'channel_certificates_cursus_start'),
  10. ORM\UniqueConstraint(name: 'unique_organization_cursust_start_certificate', fields: ['organization']),
  11. UniqueEntity(
  12. fields: ['organization'],
  13. errorPath: 'organization',
  14. )
  15. ]
  16. class CursusStartCertificate extends AbstractCertificate
  17. {
  18. #[ORM\OneToOne(inversedBy: 'certificate', targetEntity: Organization::class)]
  19. #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  20. private ?Organization $organization = null;
  21. #[ORM\Column(type: 'text', length: 10000, nullable: true)]
  22. #[Assert\NotBlank()]
  23. #[Assert\Length(max: 10000)]
  24. private ?string $body = null;
  25. #[ORM\Column(type: 'text', length: 4000, nullable: true)]
  26. #[Assert\Length(max: 4000)]
  27. private ?string $templateFooter = null;
  28. public function getBody(): ?string
  29. {
  30. return $this->body;
  31. }
  32. public function setBody(?string $body): CursusStartCertificate
  33. {
  34. $this->body = $body;
  35. return $this;
  36. }
  37. public function getOrganization(): ?Organization
  38. {
  39. return $this->organization;
  40. }
  41. public function setOrganization(?Organization $organization): CursusStartCertificate
  42. {
  43. $this->organization = $organization;
  44. return $this;
  45. }
  46. public function getTemplateFooter(): ?string
  47. {
  48. return $this->templateFooter;
  49. }
  50. public function setTemplateFooter(?string $templateFooter): CursusStartCertificate
  51. {
  52. $this->templateFooter = $templateFooter;
  53. return $this;
  54. }
  55. }