class AssetManipulationList (View source)

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

Constants

STATE_PUBLIC

STATE_PROTECTED

STATE_DELETED

Properties

protected array $public

List of public assets

protected array $protected

List of protected assets

protected array $deleted

List of deleted assets

Methods

protected
string
getAssetKey(array $asset)

Get an identifying key for a given filename and hash

public
bool
addAsset(array $asset, string $state)

Add asset with the given state

public
bool
addPublicAsset(array $asset)

Mark a file as public

public
bool
addProtectedAsset(array $asset)

Record an asset as protected

public
bool
addDeletedAsset(array $asset)

Record an asset as deleted

public
array
getPublicAssets()

Get all public assets

public
array
getProtectedAssets()

Get protected assets

public
array
getDeletedAssets()

Get deleted assets

Details

protected string getAssetKey(array $asset)

Get an identifying key for a given filename and hash

Parameters

array $asset

Asset tuple

Return Value

string

bool addAsset(array $asset, string $state)

Add asset with the given state

Parameters

array $asset

Asset tuple

string $state

One of the STATE_* const vars

Return Value

bool

True if the asset was added to the set matching the given state

bool addPublicAsset(array $asset)

Mark a file as public

Parameters

array $asset

Asset tuple

Return Value

bool

True if the asset was added to the public set

bool addProtectedAsset(array $asset)

Record an asset as protected

Parameters

array $asset

Asset tuple

Return Value

bool

True if the asset was added to the protected set

bool addDeletedAsset(array $asset)

Record an asset as deleted

Parameters

array $asset

Asset tuple

Return Value

bool

True if the asset was added to the deleted set

array getPublicAssets()

Get all public assets

Return Value

array

array getProtectedAssets()

Get protected assets

Return Value

array

array getDeletedAssets()

Get deleted assets

Return Value

array