ElggDiskFilestore::getFilenameOnFilestore PHP Méthode

getFilenameOnFilestore() public méthode

Returns an empty string if no filename set
public getFilenameOnFilestore ( ElggFile $file ) : string
$file ElggFile File object
Résultat string The full path of where the file is stored
    public function getFilenameOnFilestore(\ElggFile $file)
    {
        $owner_guid = $file->getOwnerGuid();
        if (!$owner_guid) {
            $owner_guid = _elgg_services()->session->getLoggedInUserGuid();
        }
        if (!$owner_guid) {
            $msg = "File " . $file->getFilename() . " (file guid:" . $file->guid . ") is missing an owner!";
            throw new \InvalidParameterException($msg);
        }
        $filename = $file->getFilename();
        if (!$filename) {
            return '';
        }
        $dir = new \Elgg\EntityDirLocator($owner_guid);
        return $this->dir_root . $dir . $file->getFilename();
    }