<?php
namespace App\Entity\Channel\Certificate;
use App\Entity\Channel\Organization;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
#[
ORM\Entity(),
ORM\Table(name: 'channel_certificates_cursus_start'),
ORM\UniqueConstraint(name: 'unique_organization_cursust_start_certificate', fields: ['organization']),
UniqueEntity(
fields: ['organization'],
errorPath: 'organization',
)
]
class CursusStartCertificate extends AbstractCertificate
{
#[ORM\OneToOne(inversedBy: 'certificate', targetEntity: Organization::class)]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?Organization $organization = null;
#[ORM\Column(type: 'text', length: 10000, nullable: true)]
#[Assert\NotBlank()]
#[Assert\Length(max: 10000)]
private ?string $body = null;
#[ORM\Column(type: 'text', length: 4000, nullable: true)]
#[Assert\Length(max: 4000)]
private ?string $templateFooter = null;
public function getBody(): ?string
{
return $this->body;
}
public function setBody(?string $body): CursusStartCertificate
{
$this->body = $body;
return $this;
}
public function getOrganization(): ?Organization
{
return $this->organization;
}
public function setOrganization(?Organization $organization): CursusStartCertificate
{
$this->organization = $organization;
return $this;
}
public function getTemplateFooter(): ?string
{
return $this->templateFooter;
}
public function setTemplateFooter(?string $templateFooter): CursusStartCertificate
{
$this->templateFooter = $templateFooter;
return $this;
}
}