public function serializeToJson(JsonSerializationVisitor $visitor, $item, $type) { if ($item->getThumbnailPath()) { return $this->linkService->getBaseUrl('/' . $item->getThumbnailPath()); } }