package = $package; } public function attachmentPathToAbsolutePath(?string $filename) : ?string { //Return placeholder if a part does not have an attachment if ($filename == null) { return $this->package->getUrl('/img/part_placeholder.svg'); } if (stripos($filename, "%BASE%/img/") !== false) { return $this->package->getUrl(str_replace('%BASE%', '', $filename)); } //If no other method works, return placeholder return $this->package->getUrl('/img/part_placeholder.svg'); } }