SilverStripe\Assets\AssetManipulationList
Provides a mechanism for determining the effective visibility of a set of assets (identified by filename and hash), given their membership to objects of varying visibility.
The effective visibility of assets is based on three rules:
- If an asset is attached to any public record, that asset is public.
- If an asset is not attached to any public record, but is attached to a protected record,
that asset is protected.
- If an asset is attached to a record being deleted, but not any existing public or protected
record, then that asset is marked for deletion.
Variants are ignored for the purpose of determining visibility
Synopsis
class AssetManipulationList
{
- // constants
- const STATE_PUBLIC = 'public';
- const STATE_PROTECTED = 'protected';
- const STATE_DELETED = 'deleted';
- // members
- protected array $public = ;
- protected array $protected = ;
- protected array $deleted = ;
- // methods
- protected string getAssetKey()
- public bool addAsset()
- public bool addPublicAsset()
- public bool addProtectedAsset()
- public bool addDeletedAsset()
- public array getPublicAssets()
- public array getProtectedAssets()
- public array getDeletedAssets()
Constants
Name | Value |
---|---|
STATE_PUBLIC | 'public' |
STATE_PROTECTED | 'protected' |
STATE_DELETED | 'deleted' |
Members
protected
- $deleted
—
array
List of deleted assets - $protected
—
array
List of protected assets - $public
—
array
List of public assets
Methods
protected
- getAssetKey() — Get an identifying key for a given filename and hash
public
- addAsset() — Add asset with the given state
- addDeletedAsset() — Record an asset as deleted
- addProtectedAsset() — Record an asset as protected
- addPublicAsset() — Mark a file as public
- getDeletedAssets() — Get deleted assets
- getProtectedAssets() — Get protected assets
- getPublicAssets() — Get all public assets