'partial', 'resourceNode.parent' => 'exact', ])] //resourceNode.resourceLinks.course can be used but instead cid/sid/gid is used #[ApiFilter(OrderFilter::class, properties: [ 'iid', 'filetype', 'resourceNode.title', 'resourceNode.createdAt', 'resourceNode.resourceFile.size', 'resourceNode.updatedAt', ])] class CDocument extends AbstractResource implements ResourceInterface, ResourceShowCourseResourcesInSessionInterface { /** * @ORM\Column(name="iid", type="integer") * @ORM\Id * @ORM\GeneratedValue */ #[ApiProperty(identifier: true)] #[Groups(['document:read'])] protected int $iid; /** * @ORM\Column(name="title", type="string", length=255, nullable=false) */ #[Groups(['document:read', 'document:write', 'document:browse'])] #[Assert\NotBlank] protected string $title; /** * @ORM\Column(name="comment", type="text", nullable=true) */ #[Groups(['document:read', 'document:write'])] protected ?string $comment; /** * @Assert\Choice({"folder", "file"}, message="Choose a valid filetype.") * @ORM\Column(name="filetype", type="string", length=10, nullable=false) */ #[Groups(['document:read', 'document:write'])] 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); } }