symlinker = $symlinker; } /** * {@inheritdoc} */ public function getUrl($pathFile) { $this->ensureSymlink($pathFile); return Url::factory(sprintf('/thumbnails/%s', $this->symlinker->getSymlinkBasePath($pathFile))); } /** * Creates a link if it does not exists * * @param $pathFile */ private function ensureSymlink($pathFile) { if (false === $this->symlinker->hasSymlink($pathFile)) { $this->symlinker->symlink($pathFile); } } }