*/ #[Extbase\ORM\Lazy] protected ObjectStorage $categories; /** * @var ObjectStorage */ #[Extbase\ORM\Lazy] protected ObjectStorage $tags; /** * @var ObjectStorage */ #[Extbase\ORM\Lazy] protected ObjectStorage $authors; /** * @var ObjectStorage */ #[Extbase\ORM\Lazy] protected ObjectStorage $media; public function __construct() { $this->initializeObject(); } public function initializeObject(): void { $this->categories = new ObjectStorage(); $this->tags = new ObjectStorage(); $this->authors = new ObjectStorage(); $this->media = new ObjectStorage(); } public function addCategory(Category $category): void { $this->categories->attach($category); } public function removeCategory(Category $category): void { $this->categories->detach($category); } /** * @return ObjectStorage */ public function getCategories(): ObjectStorage { return $this->categories; } /** * @param ObjectStorage $categories */ public function setCategories(ObjectStorage $categories): void { $this->categories = $categories; } public function addTag(Tag $tag): void { $this->tags->attach($tag); } public function removeTag(Tag $tag): void { $this->tags->detach($tag); } /** * @return ObjectStorage */ public function getTags(): ObjectStorage { return $this->tags; } /** * @param ObjectStorage $tags */ public function setTags(ObjectStorage $tags): void { $this->tags = $tags; } public function addAuthor(Author $author): void { $this->authors->attach($author); } public function removeAuthor(Author $author): void { $this->authors->detach($author); } /** * @return ObjectStorage */ public function getAuthors(): ObjectStorage { return $this->authors; } /** * @param ObjectStorage $authors */ public function setAuthors(ObjectStorage $authors): void { $this->authors = $authors; } /** * @return ObjectStorage */ public function getMedia(): ObjectStorage { return $this->media; } /** * @param ObjectStorage $media */ public function setMedia(ObjectStorage $media): void { $this->media = $media; } public function getFeaturedImage(): ?FileReference { return $this->featuredImage; } public function setFeaturedImage(?FileReference $featuredImage): void { $this->featuredImage = $featuredImage; } public function getHidden(): bool { return $this->hidden; } public function isHidden(): bool { return $this->getHidden(); } public function getDoktype(): int { return $this->doktype; } public function getTitle(): string { return $this->title; } public function setTitle(string $title): void { $this->title = $title; } public function getSubtitle(): string { return $this->subtitle; } public function setSubtitle(string $subtitle): void { $this->subtitle = $subtitle; } public function getAbstract(): string { return $this->abstract; } public function setAbstract(string $abstract): void { $this->abstract = $abstract; } public function getDescription(): string { return $this->description; } public function setDescription(string $description): void { $this->description = $description; } public function getCrdate(): \DateTime { return $this->crdate; } public function setCrdate(\DateTime $crdate): void { $this->crdate = $crdate; } public function getCommentsActive(): bool { return $this->commentsActive; } public function setCommentsActive(bool $commentsActive): void { $this->commentsActive = $commentsActive; } public function getArchiveDate(): int { return $this->archiveDate; } public function setArchiveDate(int $archiveDate): void { $this->archiveDate = $archiveDate; } public function getPublishDate(): int { return $this->publishDate; } public function setPublishDate(int $publishDate): void { $this->publishDate = $publishDate; } public function getUri(): string { if (class_exists(LinkFactory::class)) { return (string) GeneralUtility::makeInstance(LinkFactory::class)->create( '', [ 'parameter' => (string) $this->getUid(), 'forceAbsoluteUrl' => true ], GeneralUtility::makeInstance(ContentObjectRenderer::class) )->getUrl(); } return GeneralUtility::makeInstance(UriBuilder::class) ->setCreateAbsoluteUri(true) ->setTargetPageUid((int) $this->getUid()) ->build(); } public function getAsArray(): array { return $this->__toArray(); } public function __toArray(): array { return [ 'uid' => $this->getUid(), 'hidden' => $this->getHidden(), 'doktype' => $this->getDoktype(), 'title' => $this->getTitle(), 'subtitle' => $this->getSubtitle(), 'abstract' => $this->getAbstract(), 'description' => $this->getDescription() ]; } }