'partial', 'resourceNode.parent' => 'exact', ])] class CDocument extends AbstractResource implements ResourceInterface { use ShowCourseResourcesInSessionTrait; /** * @Groups({"document:read"}) * @ORM\Column(name="iid", type="integer") * @ORM\Id * @ORM\GeneratedValue */ protected int $iid; /** * @Groups({"document:read", "document:write", "document:browse"}) * @ORM\Column(name="title", type="string", length=255, nullable=false) */ #[Assert\NotBlank] protected string $title; /** * @Groups({"document:read", "document:write"}) * @ORM\Column(name="comment", type="text", nullable=true) */ protected ?string $comment; /** * @Groups({"document:read", "document:write"}) * @Assert\Choice({"folder", "file"}, message="Choose a valid filetype.") * @ORM\Column(name="filetype", type="string", length=10, nullable=false) */ protected string $filetype; /** * @ORM\Column(name="readonly", type="boolean", nullable=false) */ protected bool $readonly; /** * @ORM\Column(name="template", type="boolean", nullable=false) */ protected bool $template; public function __construct() { $this->comment = ''; $this->filetype = 'folder'; $this->readonly = false; $this->template = false; } public function __toString(): string { return $this->getTitle(); } public function isTemplate(): bool { return $this->template; } public function setTemplate(bool $template): self { $this->template = $template; return $this; } public function setComment(?string $comment): self { $this->comment = $comment; return $this; } public function getComment(): ?string { return $this->comment; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getTitle(): string { return $this->title; } public function setFiletype(string $filetype): self { $this->filetype = $filetype; return $this; } public function getFiletype(): string { return $this->filetype; } public function setReadonly(bool $readonly): self { $this->readonly = $readonly; return $this; } public function getReadonly(): bool { return $this->readonly; } /** * @return int */ public function getIid() { return $this->iid; } public function getResourceIdentifier(): int { return $this->getIid(); } public function getResourceName(): string { return $this->getTitle(); } public function setResourceName(string $name): self { return $this->setTitle($name); } }