private function resolveHashless(ParsedFileID $parsedFileID)
    {
        $filename = $parsedFileID->getFilename();
        $variant = $parsedFileID->getVariant();

        // Let's try to match the plain file name
        /** @var File $file */
        $file = Versioned::withVersionedMode(function () use ($filename) {
            Versioned::set_stage($this->getVersionedStage());
            return File::get()->filter(['FileFilename' => $filename])->first();
        });

        if ($file) {
            return [
                'Filename' => $filename,
                'Hash' => $file->getHash(),
                'Variant' => $variant
            ];
        }

        return null;
    }
private function resolveHashless(ParsedFileID $parsedFileID)
    {
        $filename = $parsedFileID->getFilename();
        $variant = $parsedFileID->getVariant();

        // Let's try to match the plain file name
        /** @var File $file */
        $file = Versioned::withVersionedMode(function () use ($filename) {
            Versioned::set_stage($this->getVersionedStage());
            return File::get()->filter(['FileFilename' => $filename])->first();
        });

        if ($file) {
            return [
                'Filename' => $filename,
                'Hash' => $file->getHash(),
                'Variant' => $variant
            ];
        }

        return null;
    }
private function resolveHashless ( ParsedFileID $ parsedFileID ) { $ filename = $ parsedFileID -> getFilename ( ) ; $ variant = $ parsedFileID -> getVariant ( ) ; // Let's try to match the plain file name /** @var File $file */ $ file = Versioned :: withVersionedMode ( function ( ) use ( $ filename ) { Versioned :: set_stage ( $ this -> getVersionedStage ( ) ) ; return File :: get ( ) -> filter ( [ 'FileFilename' => $ filename ] ) -> first ( ) ; } ) ; if ( $ file ) { return [ 'Filename' => $ filename , 'Hash' => $ file -> getHash ( ) , 'Variant' => $ variant ] ; } return null ; }
Try to find a DB reference for this parsed file ID that doesn't have an hash. Return a file tuple if a
equivalent file is found.
@param ParsedFileID $parsedFileID
@return array|null
Try to find a DB reference for this parsed file ID that doesn t have an hash . Return a file tuple if a equivalent file is found .