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