/** * @param Specimen $specimen * @param rCollection $collection * @return string */ public function getLink(Specimen $specimen, rCollection $collection) { $type = null; switch (strtolower($collection->getType())) { case 'h': case 'b': $type = 'botanique'; break; case 'z': $type = 'zoologie'; break; case 'p': $type = 'paleontologie'; break; case 'g': $type = 'geographie'; break; } return sprintf('%s%s/%s', $this->urlRecolnat, $type, strtoupper($specimen->getOccurrenceid())); }