<?php
namespace App\Entity;
use App\Entity\Upload;
use App\Annotation\EsUploadable;
use Doctrine\ORM\Mapping as ORM;
use App\Annotation\EsElasticIndex;
use App\Filter\SearchWithTagFilter;
use App\Repository\DocFileRepository;
use Gedmo\Mapping\Annotation as Gedmo;
use ApiPlatform\Core\Annotation\ApiFilter;
use Doctrine\Common\Collections\Collection;
use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Entity\Interfaces\OwnerMappedInterface;
use App\Entity\Interfaces\UploadMappedInterface;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Interfaces\ElasticMappedInterface;
use App\Entity\Interfaces\ContainerMappedInterface;
use App\Entity\Interfaces\NewsfeedCreatorInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\SerializedName;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\ExistsFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ApiResource(
* attributes={"security"="is_granted('ROLE_OPERATOR')"},
* normalizationContext={"groups"={"DocFile:Read"}, "skip_null_values"=false},
* denormalizationContext={"groups"={"DocFile:Write"}},
* collectionOperations={
* "get"={"security"="is_granted('IS_AUTHENTICATED_FULLY')"},
* "get_for_filter"={
* "path"="/doc_files/get-for-filter",
* "method"="GET",
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_public"={
* "path"="/doc_files/get-public",
* "method"="GET",
* "normalization_context"={"groups"={"DocFile:Read"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_for_select"={
* "path"="/doc_files/get-for-select",
* "method"="GET",
* "normalization_context"={"groups"={"DocFile:Read"}, "skip_null_values"=false},
* "security"="is_granted('ROLE_OPERATOR')"
* },
* "get_for_feed"={
* "path"="/doc_files/get-for-feed",
* "method"="GET",
* "normalization_context"={"groups"={"DocFile:Read"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_user_saved"={
* "path"="/doc_files/get-user-saved",
* "method"="GET",
* "normalization_context"={"groups"={"DocFile:Read", "TZ:Read"}, "skip_null_values"=false},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "post"={
* "route_name"="api_doc_files_post_collection",
* "method"="POST",
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "post_bulk_operation"={
* "route_name"="api_doc_files_bulk_operation_collection",
* "method"="POST",
* "denormalization_context"={"groups"={"DocFile:BulkOperation"}},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "post_ai_assistant_upload"={
* "route_name"="api_doc_files_ai_assistant_upload_collection",
* "method"="POST",
* "denormalization_context"={"groups"={"DocFile:AiAssistantUpload"}},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "post_ai_assistant_query"={
* "route_name"="api_doc_files_ai_assistant_query_collection",
* "method"="POST",
* "denormalization_context"={"groups"={"DocFile:AiAssistantQuery"}},
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* },
* itemOperations={
* "get"={
* "security"="is_granted('IS_AUTHENTICATED_FULLY')",
* "normalization_context"={"groups"={"DocFile:Read", "DocFile:AllParents", "DocFile:Versions"}, "skip_null_values"=false},
* },
* "get_dicom"={
* "path"="/doc_files/{id}/get-dicom",
* "method"="GET",
* "normalization_context"={"groups"={"DocFile:Read", "DocFile:Read-Dicom"}, "skip_null_values"=false},
* "security"="is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_OPR', object) || is_granted('IS_CO_ANY_SPE_DOCFILE_AUTHOR', object)"
* },
* "get_download"={
* "route_name"="api_doc_files_download_item",
* "method"="GET",
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "get_download_with_version"={
* "route_name"="api_doc_files_download_with_version_item",
* "method"="GET",
* "security"="is_granted('IS_AUTHENTICATED_FULLY')"
* },
* "put"={"security"="is_granted('IS_CO_OPR', object) || is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_ANY_SPE_DOCFILE_AUTHOR', object)"},
* "patch"={"security"="is_granted('IS_CO_OPR', object) || is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_ANY_SPE_DOCFILE_AUTHOR', object)"},
* "delete"={"security"="is_granted('IS_CO_OPR', object) || is_granted('IS_CO_USR_SPE', object) || is_granted('IS_CO_ANY_SPE_DOCFILE_AUTHOR', object)"}
* }
* )
* @ApiFilter(SearchFilter::class, properties={"id": "exact", "container.id": "exact", "parent.id": "exact", "user.id": "exact", "userGroups.id": "exact", "docFileTags.id": "exact", "docFileType": "exact", "origFileName": "partial", "fileName": "partial", "authors.id", "exact"})
* @ApiFilter(SearchWithTagFilter::class, properties={"search_with_tag": "partial"})
* @ApiFilter(OrderFilter::class, properties={"id": "ASC", "origFileName", "fileName", "size", "docFileType", "parent", "createdAt", "updatedAt"})
* @ApiFilter(BooleanFilter::class, properties={"isActive", "isShowDocHub", "isDownload", "isPublic"})
* @ApiFilter(ExistsFilter::class, properties={"parent.id"})
* @ORM\Entity(repositoryClass=DocFileRepository::class)
* @UniqueEntity(fields={"origFileName", "parent"}, errorPath="origFileName")
* @ORM\Table(
* name="doc_file",
* indexes={@ORM\Index(name="docfile_fileName_idx", columns={"orig_file_name"})}
* )
* @EsElasticIndex("DocFile:EL")
*/
class DocFile implements ContainerMappedInterface, OwnerMappedInterface, UploadMappedInterface, NewsfeedCreatorInterface, ElasticMappedInterface
{
/**
* @var \DateTime
* @Gedmo\Timestampable(on="create")
* @ORM\Column(type="datetime")
*
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
protected $createdAt;
/**
* @var \DateTime
* @Gedmo\Timestampable(on="update")
* @ORM\Column(type="datetime")
*
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write"})
*/
protected $updatedAt;
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getCreatedAt()
{
return $this->createdAt;
}
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"DocFile:EL", "DocFile:Read", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
* @EsUploadable()
*/
protected $fileName;
/**
* @ORM\Column(type="string", length=32)
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $docFileType;
public const DOCFILE_TYPE_FOLDER = "FOLDER";
public const DOCFILE_TYPE_URL = "URL";
public const DOCFILE_TYPE_DICOM = "DICOM";
/**
* @ORM\ManyToOne(targetEntity=DocFile::class, inversedBy="childrens")
* @ORM\JoinColumn(nullable=true, onDelete="CASCADE")
* @Groups({"DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
* @ApiProperty(readableLink=false, writableLink=false)
*/
private $parent;
/**
* @ORM\OneToMany(targetEntity=DocFile::class, mappedBy="parent")
*/
private $childrens;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $size;
/**
* @ORM\ManyToOne(targetEntity=Container::class)
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
* @Groups({"DocFile:Write"})
*/
private $container;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
* @Groups({"DocFile:Read"})
*/
private $user;
/**
* @ORM\ManyToMany(targetEntity=UserGroup::class)
* @Groups({"DocFile:Read", "DocFile:Write"})
*/
private $userGroups;
/**
* @ORM\ManyToMany(targetEntity=DocFileTag::class, inversedBy="docFiles", cascade={"persist"})
* @Groups({"DocFile:Read", "DocFile:Write"})
*/
private $docFileTags;
/**
* @var string
* @Groups({"DocFile:BulkOperation"})
*/
private $operation;
public const DOCFILE_OPERATION_COPY = "COPY";
public const DOCFILE_OPERATION_MOVE = "MOVE";
public const DOCFILE_OPERATION_DELETE = "DELETE";
public const DOCFILE_OPERATION_DOWNLOAD = "DOWNLOAD";
/**
* @var int[]
* @Groups({"DocFile:BulkOperation"})
*/
private $source;
/**
* @var ?int
* @Groups({"DocFile:BulkOperation"})
*/
private $target;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $origFileName;
/**
* @ORM\Column(type="json", nullable=true)
* @Groups({"DocFile:Read"})
*/
private $path = [];
/**
* @ORM\OneToMany(targetEntity=DocFileBlock::class, mappedBy="docFile", orphanRemoval=true, cascade={"persist"})
* @Groups({"DocFile:Read"})
*/
private $docFileBlocks;
/**
* @ORM\OneToMany(targetEntity=CommonComment::class, mappedBy="docFile")
*/
private $commonComments;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $isPublic;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $isDownload = true;
/**
* @ORM\ManyToMany(targetEntity=User::class)
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write"})
*/
private $authors;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $isShowDocHub;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $isActive;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
private $isCommentEnable = true;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
* @EsUploadable()
*/
private $imageName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"DocFile:Read", "DocFile:Write"})
*/
private $url;
/**
* @ORM\Column(type="json", nullable=true)
* @Groups({"DocFile:Read-Dicom", "DocFile:Write"})
*/
private $dicomFileInfo = [];
/**
* @ORM\ManyToOne(targetEntity=CommonCategory::class)
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*
* @Groups({"DocFile:Read", "DocFile:Write"})
*/
private $docFileCategory;
/**
* @ORM\Column(type="string", length=32, nullable=true)
* @Groups({"DocFile:Read", "DocFile:Write"})
*/
private $reminderDurationType;
public const DOCFILE_REMINDERDURATIONTYPE_DAY = "DAY";
public const DOCFILE_REMINDERDURATIONTYPE_MONTH = "MONTH";
public const DOCFILE_REMINDERDURATIONTYPE_YEAR = "YEAR";
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"DocFile:Read", "DocFile:Write"})
*/
private $reminderDuration;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"DocFile:Read", "DocFile:Write"})
*/
private $isReminderRepeat;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"DocFile:Read"})
*/
private $nextReminder;
/**
* @ORM\OneToMany(targetEntity=DocFileVersion::class, mappedBy="docFile", orphanRemoval=true, cascade={"persist"})
* @Groups({"DocFile:Versions", "DocFile:Write"})
*/
private $docFileVersions;
/**
* @var int
* @Groups({"DocFile:AiAssistantUpload"})
*/
private $docFileId;
/**
* @var string
* @Groups({"DocFile:AiAssistantQuery"})
*/
private $aiAssistantQuestion;
/**
* @var string
* @Groups({"DocFile:AiAssistantQuery"})
*/
private $aiAssistantFileId;
/**
* @ORM\OneToMany(targetEntity=DocFileSaved::class, mappedBy="docFile")
*/
private $docFileSaved;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $aiFileId;
public function __construct()
{
$this->childrens = new ArrayCollection();
$this->userGroups = new ArrayCollection();
$this->docFileTags = new ArrayCollection();
$this->docFileBlocks = new ArrayCollection();
$this->commonComments = new ArrayCollection();
$this->isDownload = true;
$this->isShowDocHub = true;
$this->isCommentEnable = true;
$this->authors = new ArrayCollection();
$this->docFileVersions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getFileName(): ?string
{
return $this->fileName;
}
public function setFileName(?string $fileName): self
{
$this->fileName = $fileName;
return $this;
}
public function getDocFileType(): ?string
{
return $this->docFileType;
}
public function setDocFileType(string $docFileType): self
{
$this->docFileType = $docFileType;
return $this;
}
public function getParent(): ?self
{
return $this->parent;
}
public function setParent(?self $parent): self
{
$this->parent = $parent;
return $this;
}
/**
* @return Collection|self[]
*/
public function getChildrens(): Collection
{
return $this->childrens;
}
public function addChildren(self $children): self
{
if (!$this->childrens->contains($children)) {
$this->childrens[] = $children;
$children->setParent($this);
}
return $this;
}
public function removeChildren(self $children): self
{
if ($this->childrens->removeElement($children)) {
// set the owning side to null (unless already changed)
if ($children->getParent() === $this) {
$children->setParent(null);
}
}
return $this;
}
public function getSize(): ?int
{
return $this->size;
}
public function setSize(?int $size): self
{
$this->size = $size;
return $this;
}
public function getContainer(): ?Container
{
return $this->container;
}
public function setContainer(?Container $container): self
{
$this->container = $container;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
/**
* @return Collection|UserGroup[]
*/
public function getUserGroups(): Collection
{
return $this->userGroups;
}
/**
* @Groups({"DocFile:EL"})
* @SerializedName("groups")
*/
public function getUserGroupsArray()
{
$groups = [];
foreach ($this->userGroups as $group) {
if (!$group->getIsGenerated()) {
$groups[] = $group->getId();
}
}
return $groups;
}
public function addUserGroup(UserGroup $userGroup): self
{
if (!$this->userGroups->contains($userGroup)) {
$this->userGroups[] = $userGroup;
}
return $this;
}
public function removeUserGroup(UserGroup $userGroup): self
{
$this->userGroups->removeElement($userGroup);
return $this;
}
public function removeAllUserGroups(): self
{
foreach ($this->userGroups as $userGroup) {
$this->removeUserGroup($userGroup);
}
return $this;
}
/**
* @return Collection|DocFileTag[]
*/
public function getDocFileTags(): Collection
{
return $this->docFileTags;
}
/**
* @Groups({"DocFile:EL"})
* @SerializedName("tags")
*/
public function getTagsArray()
{
$tags = [];
foreach ($this->docFileTags as $tag) {
$tags[] = $tag->getName();
}
return $tags;
}
public function addDocFileTag(DocFileTag $docFileTag): self
{
if (!$this->docFileTags->contains($docFileTag)) {
$this->docFileTags[] = $docFileTag;
}
return $this;
}
public function removeDocFileTag(DocFileTag $docFileTag): self
{
$this->docFileTags->removeElement($docFileTag);
return $this;
}
public function reAttachTags(): self
{
$tags = $this->docFileTags;
foreach ($tags as $tag) {
$nt = clone $tag;
$nt->setContainer($this->getContainer());
$this->removeDocFileTag($tag);
$this->addDocFileTag($nt);
}
return $this;
}
/**
* Get the value of operation
*
* @return string
*/
public function getOperation()
{
return $this->operation;
}
/**
* Set the value of operation
*
* @param string $operation
*
* @return self
*/
public function setOperation(string $operation)
{
$this->operation = $operation;
return $this;
}
/**
* Get the value of source
*
* @return int[]
*/
public function getSource()
{
return $this->source;
}
/**
* Set the value of source
*
* @param int[] $source
*
* @return self
*/
public function setSource(array $source)
{
$this->source = $source;
return $this;
}
/**
* Get the value of target
*
* @return ?int
*/
public function getTarget()
{
return $this->target;
}
/**
* Set the value of target
*
* @param ?int $target
*
* @return self
*/
public function setTarget(?int $target)
{
$this->target = $target;
return $this;
}
public function getOrigFileName(): ?string
{
return $this->origFileName;
}
public function setOrigFileName(string $origFileName): self
{
$this->origFileName = $origFileName;
return $this;
}
public function getPath(): ?array
{
return $this->path;
}
public function setPath(?array $path): self
{
$this->path = $path;
return $this;
}
/**
* @Groups({"DocFile:AllParents"})
*/
public function getAllParents(): ?array
{
$parents = [];
$parent = $this->getParent();
if ($parent) {
do {
$parents[] = $parent;
$parent = $parent->getParent();
} while ($parent);
}
return $parents;
}
/**
* @return Collection|DocFileBlock[]
*/
public function getDocFileBlocks(): Collection
{
return $this->docFileBlocks;
}
public function addDocFileBlock(DocFileBlock $docFileBlock): self
{
if (!$this->docFileBlocks->contains($docFileBlock)) {
$this->docFileBlocks[] = $docFileBlock;
$docFileBlock->setDocFile($this);
}
return $this;
}
public function removeDocFileBlock(DocFileBlock $docFileBlock): self
{
if ($this->docFileBlocks->removeElement($docFileBlock)) {
// set the owning side to null (unless already changed)
if ($docFileBlock->getDocFile() === $this) {
$docFileBlock->setDocFile(null);
}
}
return $this;
}
/**
* @return Collection|CommonComment[]
*/
public function getCommonComments(): Collection
{
return $this->commonComments;
}
public function addCommonComment(CommonComment $commonComment): self
{
if (!$this->commonComments->contains($commonComment)) {
$this->commonComments[] = $commonComment;
$commonComment->setDocFile($this);
}
return $this;
}
public function removeCommonComment(CommonComment $commonComment): self
{
if ($this->commonComments->removeElement($commonComment)) {
// set the owning side to null (unless already changed)
if ($commonComment->getDocFile() === $this) {
$commonComment->setDocFile(null);
}
}
return $this;
}
public function getIsPostEnable()
{
return (count($this->userGroups) < 1);
}
public function getPostText()
{
return $this->getOrigFileName();
}
public function getPostPoster()
{
return '';
}
public function getPostMetadata()
{
$authors = [];
foreach ($this->getAuthors() as $a) {
$authors[] = $a->getMetadata();
}
return [
'docFile' => [
'id' => $this->getId(),
'origFileName' => $this->getOrigFileName(),
'fileName' => $this->getFileName(),
'docFileType' => $this->getDocFileType(),
'size' => $this->getSize(),
'path' => $this->getPath(),
'imageName' => $this->getImageName(),
'isImage' => $this->getIsImage(),
'tags' => $this->getTagsArray(),
'docFileCategory' => $this->getDocFileCategory() ? $this->getDocFileCategory()->getMeta() : null,
'authors' => $authors
]
];
}
public function getPostSource()
{
return CommonComment::SOURCE_DOCFILEBLOCK;
}
public function getPostSubSource()
{
return Newsfeed::POSTSUBTYPE_DOCUMENT;
}
public function getPostUserGroups()
{
return $this->getUserGroups();
}
public function getIsPublic(): ?bool
{
return $this->isPublic;
}
public function setIsPublic(?bool $isPublic): self
{
$this->isPublic = $isPublic;
return $this;
}
public function getIsDownload(): ?bool
{
return $this->isDownload;
}
public function setIsDownload(?bool $isDownload): self
{
$this->isDownload = $isDownload;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getAuthors(): Collection
{
return $this->authors;
}
public function addAuthor(User $author): self
{
if (!$this->authors->contains($author)) {
$this->authors[] = $author;
}
return $this;
}
public function removeAuthor(User $author): self
{
$this->authors->removeElement($author);
return $this;
}
public function removeAllAuthors(): self
{
foreach ($this->authors as $author) {
$this->removeAuthor($author);
}
return $this;
}
public function getIsShowDocHub(): ?bool
{
return $this->isShowDocHub;
}
public function setIsShowDocHub(?bool $isShowDocHub): self
{
$this->isShowDocHub = $isShowDocHub;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getIsCommentEnable(): ?bool
{
return $this->isCommentEnable;
}
public function setIsCommentEnable(?bool $isCommentEnable): self
{
$this->isCommentEnable = $isCommentEnable;
return $this;
}
/**
* @Groups({"DocFile:EL", "DocFile:Read", "DocFile:Write", "ElTask:Read", "ElExam:Read-Solution"})
*/
public function getIsImage(): bool
{
$ext = strtolower(pathinfo($this->getFileName(), PATHINFO_EXTENSION));
return in_array($ext, Upload::IMAGE_TYPES);
}
public function getImageName(): ?string
{
return $this->imageName;
}
public function setImageName(?string $imageName): self
{
$this->imageName = $imageName;
return $this;
}
/**
* @Groups({"DocFile:EL"})
*/
public function getCntId()
{
return $this->container->getId();
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
public function getDicomFileInfo(): ?array
{
return $this->dicomFileInfo;
}
public function setDicomFileInfo(?array $dicomFileInfo): self
{
$this->dicomFileInfo = $dicomFileInfo;
return $this;
}
public function getDocFileCategory(): ?CommonCategory
{
return $this->docFileCategory;
}
public function setDocFileCategory(?CommonCategory $docFileCategory): self
{
$this->docFileCategory = $docFileCategory;
return $this;
}
public function getReminderDurationType(): ?string
{
return $this->reminderDurationType;
}
public function setReminderDurationType(?string $reminderDurationType): self
{
$this->reminderDurationType = $reminderDurationType;
return $this;
}
public function getReminderDuration(): ?int
{
return $this->reminderDuration;
}
public function setReminderDuration(?int $reminderDuration): self
{
$this->reminderDuration = $reminderDuration;
return $this;
}
public function getIsReminderRepeat(): ?bool
{
return $this->isReminderRepeat;
}
public function setIsReminderRepeat(?bool $isReminderRepeat): self
{
$this->isReminderRepeat = $isReminderRepeat;
return $this;
}
public function getNextReminder(): ?\DateTimeInterface
{
return $this->nextReminder;
}
public function setNextReminder(?\DateTimeInterface $nextReminder): self
{
$this->nextReminder = $nextReminder;
return $this;
}
/**
* @return Collection<int, DocFileVersion>
*/
public function getDocFileVersions(): Collection
{
return $this->docFileVersions;
}
public function addDocFileVersion(DocFileVersion $docFileVersion): self
{
if (!$this->docFileVersions->contains($docFileVersion)) {
$this->docFileVersions[] = $docFileVersion;
$docFileVersion->setDocFile($this);
}
return $this;
}
public function removeDocFileVersion(DocFileVersion $docFileVersion): self
{
if ($this->docFileVersions->removeElement($docFileVersion)) {
// set the owning side to null (unless already changed)
if ($docFileVersion->getDocFile() === $this) {
$docFileVersion->setDocFile(null);
}
}
return $this;
}
public function getDocFileId()
{
return $this->docFileId;
}
public function setDocFileId(int $docFileId)
{
$this->docFileId = $docFileId;
return $this;
}
public function getAiAssistantQuestion()
{
return $this->aiAssistantQuestion;
}
public function setAiAssistantQuestion(string $aiAssistantQuestion)
{
$this->aiAssistantQuestion = $aiAssistantQuestion;
return $this;
}
public function getAiAssistantFileId()
{
return $this->aiAssistantFileId;
}
public function setAiAssistantFileId(string $aiAssistantFileId)
{
$this->aiAssistantFileId = $aiAssistantFileId;
return $this;
}
/**
* @return Collection<int, DocFileSaved>
*/
public function getDocFileSaved(): Collection
{
return $this->docFileSaved;
}
public function addNewsfeedSaved(DocFileSaved $docFileSaved): self
{
if (!$this->docFileSaved->contains($docFileSaved)) {
$this->docFileSaved[] = $docFileSaved;
$docFileSaved->setDocFile($this);
}
return $this;
}
public function removeDocFileSaved(DocFileSaved $docFileSaved): self
{
if ($this->docFileSaved->removeElement($docFileSaved)) {
// set the owning side to null (unless already changed)
if ($docFileSaved->getDocFile() === $this) {
$docFileSaved->setDocFile(null);
}
}
return $this;
}
public function getAiFileId(): ?string
{
return $this->aiFileId;
}
public function setAiFileId(?string $aiFileId): self
{
$this->aiFileId = $aiFileId;
return $this;
}
}