symlinker = $symlinker; parent::__construct($mapping); } /** * {@inheritdoc} */ public function getUrl($pathFile) { $this->ensureSymlink($pathFile); return Url::factory(sprintf('%s/%s', $this->mapping['mount-point'], $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); } } }