id; } public function getUrl(): ?string { return $this->url; } public function getAlt(): ?string { return $this->alt; } public function getName(): ?string { return $this->name; } public function getType(): ?string { return $this->type; } public function getSource(): ?string { return $this->source; } public function getDescription(): ?string { return $this->description; } public function getLicense(): ?string { return $this->license; } public function getExt(): ?string { return $this->ext; } public function getHash(): ?string { return $this->hash; } public function isImage(): bool { return str_starts_with($this->type ?? '', 'image/'); } /** * Matches the path EventRepository.saveMediaFile writes to in the Go * importer: ./public/storage//. */ public function getStoragePath(): ?string { if (!$this->hash) { return null; } $mediaType = strtolower((string) (strstr($this->type ?? '', '/', true) ?: 'other')); return sprintf('/storage/%s/%s%s', $mediaType, $this->hash, $this->ext); } }