Returns the id of the source MediaFile object that this file was generated from.

@return \Psr\Http\Message\UriInterface
975017
public function getSourceMediaFileId(): \Psr\Http\Message\UriInterface
    {
        if (!$this->sourceMediaFileId) {
            return new Uri();
        }

        return $this->sourceMediaFileId;
    }
636550
public function getFile()
    {
        if (!$this->hasGetParameter('uri')) {
            throw new \common_exception_Error('invalid media identifier');
        }
        $uri = urldecode($this->getGetParameter('uri'));

        $mediaSource = new MediaSource(array());
        $fileInfo = $mediaSource->getFileInfo($uri);

        $fileManagement = $this->getServiceLocator()->get(FileManagement::SERVICE_ID);
        $stream = $fileManagement->getFileStream($fileInfo['link']);
        if ($fileInfo['mime'] === 'application/qti+xml') {
            $this->response = $this->getPsrResponse()->withBody($stream);
        } elseif ($this->hasGetParameter('xml')) {
            $this->returnJson(htmlentities((string)$stream));
        } else {
            $this->setContentHeader($fileInfo['mime']);
            $this->response = $this->getPsrResponse()->withBody($stream);
        }
    }
880895
public function getSafeFileName()
    {
        $fileExtension = pathinfo($this->file->getClientOriginalName(), PATHINFO_EXTENSION);
        $mimeTypeExtension = $this->file->guessExtension();
        $newExtension = !empty($mimeTypeExtension) ? $mimeTypeExtension : $fileExtension;

        $baseName = !empty($fileExtension) ? basename($this->file->getClientOriginalName(), $fileExtension) : $this->file->getClientOriginalName();
        $safeBaseName = Transliterator::urlize($baseName);

        return $safeBaseName . (!empty($newExtension) ? '.' . $newExtension : '');
    }
701813
public function getTransformId(): \Psr\Http\Message\UriInterface
    {
        if (!$this->transformId) {
            return new Uri();
        }

        return $this->transformId;
    }
400501
public function getResourceId()
    {
        if ( null === $this->aclResourceId )
        {
            $this->aclResourceId = 'user.group.' . ( (int) $this->groupId )
                . '.identity.' . ( (int) $this->id );
        }

        return $this->aclResourceId;
    }
448328
public function getUrl(): string
    {
        $url = $this->getPathRelativeToRoot();

        if ($root = config('filesystems.disks.'.$this->media->disk.'.root')) {
            $url = $root.'/'.$url;
        }

        $url = $this->rawUrlEncodeFilename($url);

        return config('medialibrary.s3.domain').'/'.$url;
    }
418285
public function getFormId()
    {
        if ($this->_sFormId === null) {
            $this->_sFormId = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUId();
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('sessionuformid', $this->_sFormId);
        }

        return $this->_sFormId;
    }
304848
public function getPublicPath()
    {
        if (! $this->isPubliclyAccessible()) {
            throw MediaUrlException::mediaNotPubliclyAccessible($this->getAbsolutePath(), public_path());
        }
        if ($this->isInWebroot()) {
            $path = str_replace(public_path(), '', $this->getAbsolutePath());
        } else {
            $path = rtrim($this->getPrefix(), '/').'/'.$this->media->getDiskPath();
        }

        return $this->cleanDirectorySeparators($path);
    }
882850
public function getMediaType()
    {
        if ($this->mediaType === null) {
            return Utility\MediaTypes::getMediaTypeFromFilename($this->filename);
        } else {
            return $this->mediaType;
        }
    }
917346
public function getTorrentId()
  {
    if ($this->torrentId === null) {
      $this->torrentId = false;

      if (preg_match('~tid=([0-9]+)~', $this->torrentUrl, $match)) {
        $this->torrentId = intval($match[1]);
      }
    }

    return $this->torrentId;
  }
279699
public function getUrlPageName()
    {
        if (static::$urlPageName !== null) {
            return static::$urlPageName;
        }

        /*
         * Cache
         */
        $key = 'urlMaker'.$this->urlComponentName.crc32(get_class($this));

        $cached = Cache::get($key, false);
        if ($cached !== false && ($cached = @unserialize($cached)) !== false) {
            $filePath = array_get($cached, 'path');
            $mtime = array_get($cached, 'mtime');
            if (!File::isFile($filePath) || ($mtime != File::lastModified($filePath))) {
                $cached = false;
            }
        }

        if ($cached !== false) {
            return static::$urlPageName = array_get($cached, 'fileName');
        }

        /*
         * Fallback
         */
        $page = null;
        $useProperty = property_exists($this, 'urlComponentProperty');

        if ($useProperty) {
            $page = Page::whereComponent($this->urlComponentName, $this->urlComponentProperty, '1')->first();
        }

        if (!$useProperty || !$page) {
            $page = Page::withComponent($this->urlComponentName)->first();
        }

        if (!$page) {
            throw new ApplicationException(sprintf(
                'Unable to a find a primary component "%s" for generating a URL in %s.',
                $this->urlComponentName,
                get_class($this)
            ));
        }

        $baseFileName = $page->getBaseFileName();
        $filePath = $page->getFilePath();

        $cached = [
            'path'     => $filePath,
            'fileName' => $baseFileName,
            'mtime'    => @File::lastModified($filePath)
        ];

        Cache::put($key, serialize($cached), Config::get('cms.parsedPageCacheTTL', 1440));

        return static::$urlPageName = $baseFileName;
    }
493597
public function toUri(): UriInterface
    {
        $str = $this::BASE_URL.$this->account->getPid().'/'.$this->player->getPid();

        if ($this->embed) {
            $str .= '/embed';
        }

        if ($this->byGuid) {
            $ownerId = $this->media->getOwnerId();
            $parts = explode('/', $ownerId);
            $numeric_id = end($parts);

            $uri = new Uri($str.'/select/media/guid/'.$numeric_id.'/'.$this->media->getGuid());
        } else {
            $uri = new Uri($str.'/select/media/'.$this->media->getPid());
        }

        $query_parts = [];

        // We use isset() so that if the values have never been explicitly set
        // the player configuration is used instead.
        if (isset($this->autoPlay)) {
            $query_parts['autoPlay'] = $this->autoPlay ? 'true' : 'false';
        }

        if (isset($this->playAll)) {
            $query_parts['playAll'] = $this->playAll ? 'true' : 'false';
        }

        $uri = $uri->withQuery(build_query($query_parts));

        return $uri;
    }
896333
public function getServerFilename(): string
    {
        $MEDIA_DIRECTORY = $this->media->tree()->getPreference('MEDIA_DIRECTORY');

        if ($this->multimedia_file_refn === '' || $this->isExternal()) {
            // External image, or (in the case of corrupt GEDCOM data) no image at all
            return $this->multimedia_file_refn;
        }

        // Main image
        return WT_DATA_DIR . $MEDIA_DIRECTORY . $this->multimedia_file_refn;
    }
679337
public function getRestrictionId(): \Psr\Http\Message\UriInterface
    {
        if (!$this->restrictionId) {
            return new Uri();
        }

        return $this->restrictionId;
    }
927292
public function getUrlAttribute()
    {
        if ($this->isLocalFile()) {
            return url(str_replace('public/', 'storage/', $this->location));
        } elseif ($this->fileExists()) {
            return $this->getS3Image();
        }

        return $this->lostImage();
    }
66009
public function getUrl()
    {
        $data = $this->getRawData();
        /**
         * If data is already an url don't save new file
         */
        if ($data && !filter_var($data, FILTER_VALIDATE_URL) !== false)
        {
            if(!is_string($data))
            {
                $data = \GuzzleHttp\json_encode($data);
            }
            $identifier = Auth::guest() ? time() : Auth::id();
            $file = $this->dataFolder.DIRECTORY_SEPARATOR.md5($identifier).'.json';
            Storage::disk('public')->put($file, $data);

            $data =  asset($this->publicStorageFolder.DIRECTORY_SEPARATOR.$file);
        }

        return $data;
    }
287728
public function getMediaUri()
    {
       $folder = $this->getMediaFolder();

       if (strpos($folder, '://')) {
           return $folder;
       }

       /** @var UniformResourceLocator $locator */
       $locator = Grav::instance()['locator'];
       $user = $locator->findResource('user://');
       if (strpos($folder, $user) === 0) {
           return 'user://' . substr($folder, \strlen($user)+1);
       }

       return null;
    }