symlinker = $symlinker; } /** * @param $pathFile * @param null|string $etag * @return Url */ public function getUrl($pathFile, $etag = null) { $this->ensureSymlink($pathFile); $url = sprintf('/thumbnails/%s', $this->symlinker->getSymlinkBasePath($pathFile)); if($etag !== null) { $url .= "?etag=" . urlencode($etag); } return Url::factory($url); } /** * Creates a link if it does not exists * * @param $pathFile */ private function ensureSymlink($pathFile) { if (false === $this->symlinker->hasSymlink($pathFile)) { $this->symlinker->symlink($pathFile); } } }