62 lines
1.2 KiB
PHP
62 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Entity\Document;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use App\Repository\MedicalRepository;
|
|
use Gedmo\Mapping\Annotation as Gedmo;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
/**
|
|
* @ORM\Entity(repositoryClass=MedicalRepository::class)
|
|
*/
|
|
class Medical extends Document
|
|
{
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity=Directory::class, inversedBy="medicals")
|
|
* @ORM\JoinColumn(nullable=false)
|
|
*/
|
|
private $directory;
|
|
|
|
/**
|
|
* @ORM\Column(type="text", length=65535)
|
|
* @Gedmo\Versioned
|
|
* @Assert\Length(
|
|
* max=65535,
|
|
* maxMessage="Content too long : {{ limit }} max"
|
|
* )
|
|
*/
|
|
private $content;
|
|
|
|
public function __construct(User $user)
|
|
{
|
|
parent::__construct($user);
|
|
$this->setNeedMedicalAccess(true);
|
|
}
|
|
|
|
public function getDirectory(): ?Directory
|
|
{
|
|
return $this->directory;
|
|
}
|
|
|
|
public function setDirectory(?Directory $directory): self
|
|
{
|
|
$this->directory = $directory;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getContent(): ?string
|
|
{
|
|
return $this->content;
|
|
}
|
|
|
|
public function setContent(string $content): self
|
|
{
|
|
$this->content = $content;
|
|
|
|
return $this;
|
|
}
|
|
}
|