*/ #[Extbase\ORM\Lazy] protected ObjectStorage $posts; public function __construct() { $this->initializeObject(); } public function initializeObject(): void { $this->posts = new ObjectStorage(); } /** * @return ObjectStorage */ public function getPosts(): ObjectStorage { return $this->posts; } /** * @param ObjectStorage $posts */ public function setPosts(ObjectStorage $posts): void { $this->posts = $posts; } public function addPost(Post $post): void { $this->posts->attach($post); } public function removePost(Post $post): void { $this->posts->detach($post); } public function getName(): ?string { return $this->name; } public function setName(string $name): void { $this->name = $name; } public function getTitle(): string { return $this->title; } public function setTitle(string $title): void { $this->title = $title; } public function getImage(): ?FileReference { return $this->image; } public function setImage(FileReference $image): void { $this->image = $image; } public function getWebsite(): string { return $this->website; } public function setWebsite(string $website): void { $this->website = $website; } public function getEmail(): string { return $this->email; } public function setEmail(string $email): void { $this->email = $email; } public function getProfile(): string { return $this->profile; } public function setProfile(string $profile): void { $this->profile = $profile; } public function getBio(): string { return $this->bio; } public function setBio(string $bio): void { $this->bio = $bio; } public function getDetailsPage(): int { return $this->detailsPage; } public function setDetailsPage(int $page): void { $this->detailsPage = $page; } public function getAllTags(): array { $uniqueTags = []; foreach ($this->getPosts() as $post) { foreach ($post->getTags() as $tag) { if (!array_key_exists((int) $tag->getUid(), $uniqueTags)) { $uniqueTags[(int) $tag->getUid()] = $tag; } } } return $uniqueTags; } }