SilverStripe\Assets\FilenameParsing\FileResolutionStrategy
Represents a strategy for resolving files on a Flysystem Adapter.
Synopsis
interface FileResolutionStrategy
{
- // methods
- public ParsedFileID|null resolveFileID()
- public ParsedFileID|null softResolveFileID()
- public ParsedFileID generateVariantFileID()
- public ParsedFileID|null searchForTuple()
- public string buildFileID()
- public ParsedFileID parseFileID()
- public array findVariants()
- public string cleanFilename()
- public ParsedFileID|null stripVariant()
Methods
public
- buildFileID() — Build a file ID for the provided tuple, irrespective of its existence.
- cleanFilename() — Normalise a filename to be consistent with this file resolution strategy.
- findVariants() — Find all the variants of the provided tuple
- generateVariantFileID() — Build a file ID for a variant so it follows the pattern of its original file. The variant may not exist on the Filesystem yet, but the original file has to. This is to make sure that variant files always follow the same pattern as the original file they are attached to.
- parseFileID() — Try to resolve the provided file ID string irrespective of whether it exists on the Filesystem or not.
- resolveFileID() — Try to resolve a file ID against the provided Filesystem.
- searchForTuple() — Try to find a file ID for an existing file using the provided file tuple.
- softResolveFileID() — Try to resolve a file ID against the provided Filesystem looking at newer versions of the file.
- stripVariant() — Given a fileID string or a Parsed File ID, create a matching ParsedFileID without any variant.