Methods

RegisterAsset()

RegisterAsset(integer  $id,string  $type,string  $ext): \FAA\Obj\Result

Register a base asset in the storage

Parameters

integer $id

An asset base id

string $type

The object type

string $ext

The original files extension

Returns

\FAA\Obj\Result —

A system result object

DeleteAssetDerivative()

DeleteAssetDerivative(integer  $id,string  $type,string  $hash,string  $file): \FAA\Obj\Result

Delete a asset derivative from remote

Parameters

integer $id

An asset base id

string $type

The object type

string $hash

The object main hash

string $file

The derivative file name

Returns

\FAA\Obj\Result —

A system result object

GetRenderProgress()

GetRenderProgress(integer  $id,string  $type,string  $hash): \FAA\Obj\Result

Get progress of certain asset rendering status

Will filter the not found case and set the value to -1 instead

Parameters

integer $id

An asset base id

string $type

The object type

string $hash

The object main hash

Returns

\FAA\Obj\Result —

A system result object

DeleteAsset()

DeleteAsset(integer  $id,string  $type): \FAA\Obj\Result

Delete a whole asset from remote

Parameters

integer $id

An asset base id

string $type

The object type

Returns

\FAA\Obj\Result —

A system result object

LoadAssetDerivatives()

LoadAssetDerivatives(integer  $id,string  $type): \FAA\Obj\Result

Fetch list from service

Downloads the set of available assets and sub assets from server. Includes the size the hash and the extension of the file.

Parameters

integer $id

An asset base id

string $type

The object type

Returns

\FAA\Obj\Result —

A system result object

ChangeAssetRotation()

ChangeAssetRotation(integer  $id,string  $type,string  $hash,integer  $degree): \FAA\Obj\Result

Correct the rotation of a certain asset file

Parameters

integer $id

An asset base id

string $type

The object type

string $hash

The asset main content hash

integer $degree

The correction factor between -360 and 360

Returns

\FAA\Obj\Result —

A system result object

DownloadAsset()

DownloadAsset(integer  $id,string  $type,string  $hash,string  $ext,boolean  $force = false): \FAA\Obj\Result

Download a certain asset file to local storage

Parameters

integer $id

An asset base id

string $type

The object type

string $hash

The asset main content hash

string $ext

The file extension

boolean $force

Forced download

Returns

\FAA\Obj\Result —

A system result object

CreateMpegDash()

CreateMpegDash(integer  $id,string  $type,string  $hash,array  $operations): \FAA\Obj\Result

Create mpeg dash instance of asset

Parameters

integer $id

An asset base id

string $type

The object type

string $hash

The asset main content hash

array $operations

The set of dash operations to perform

Returns

\FAA\Obj\Result —

A system result object

CropAssetDerivative()

CropAssetDerivative(integer  $id,string  $type,string  $hash,array  $operation): \FAA\Obj\Result

Crop, shrink and compress a certain image in the asset service

Parameters

integer $id

An asset base id

string $type

The object type

string $hash

The asset main content hash

array $operation

The asset crop operation definition

Returns

\FAA\Obj\Result —

A system result object

UploadAlternativeAssetDerivative()

UploadAlternativeAssetDerivative(integer  $id,string  $type,string  $version,string  $hash,string  $file): \FAA\Obj\Result

Upload a alternative asset file to the asset service

Parameters

integer $id

An asset base id

string $type

The object type

string $version

The current main version hash

string $hash

The asset main content hash

string $file

Absolute path to the new derivative file

Returns

\FAA\Obj\Result —

A system result object

UploadAssetDerivative()

UploadAssetDerivative(integer  $id,string  $type,string  $file): \FAA\Obj\Result

Upload a base asset file to the asset service

Parameters

integer $id

An asset base id

string $type

The object type

string $file

Absolute path to target file

Returns

\FAA\Obj\Result —

A system result object

GetAssetTypes()

GetAssetTypes(): \FAA\Obj\Result

get asset types form storage load the list of registered and related asset objects

Returns

\FAA\Obj\Result —

a system result object

LoadDerivateConfig()

LoadDerivateConfig(string  $type = 'asset',boolean  $keys = false): \FAA\Obj\Result

Get derivatives provide a list of available derivatives attributes of the content type asset

Parameters

string $type

The name of the basic object type

boolean $keys

Return the keys only

Returns

\FAA\Obj\Result —

A system result object

OpenAsset()

OpenAsset(integer  $id,null  $type = null): \FAA\Obj\Generic\Asset|null

Open a asset object Uses the general handler to open a type by usage of overloaded asset types filer.

Parameters

integer $id

The asset id

null $type

Returns

\FAA\Obj\Generic\Asset|null —

Asset object or null when not found

LoadTypesWithAssetAttribute()

LoadTypesWithAssetAttribute(string  $language = null): \FAA\Obj\Result

Get list of types that have an asset attribute

This function loads all content types that have an attribute which contains assets as relation. For example shop articles or news with a main image or a list of images.

Parameters

string $language

The resolver target language

Returns

\FAA\Obj\Result —

A system result object with list of asset containing objects

IsMedia()

IsMedia(string  $path,string  $file,string  $language): boolean

test if path is valid virtual image call this function can't resolve bot opt links, they must be mapped before

Parameters

string $path

Virtual directory folder path

string $file

The requested file path

string $language

The request language

Returns

boolean —

Indicator whether this is a valid virtual or not

CreateNamedAssetPath()

CreateNamedAssetPath(\FAA\Obj\Generic\Asset  $asset,string  $image_type,string  $name,string  $prefix = null): \FAA\Obj\Result

Register an improved, readable link to an asset in the asset service

Parameters

\FAA\Obj\Generic\Asset $asset

The asset to compile

string $image_type

The asset derivative type

string $name

The asset speaking path name

string $prefix

The prefix

Returns

\FAA\Obj\Result

PrepareImprovedPublicUrl()

PrepareImprovedPublicUrl(\FAA\Obj\Generic\Asset  $asset,string  $language,string  $size,string  $prefix = null): \FAA\Obj\Result

Parameters

\FAA\Obj\Generic\Asset $asset

An asset instance

string $language
string $size

The derivative type

string $prefix

A prefix, can be name of the parent content

Returns

\FAA\Obj\Result

ImprovedPublicUrl()

ImprovedPublicUrl(\FAA\Obj\Request  $request,\FAA\Obj\Generic\Asset  $asset,string  $size,string  $prefix = null,boolean  $absolute = false): string

Parameters

\FAA\Obj\Request $request

A system http request object

\FAA\Obj\Generic\Asset $asset

An asset instance

string $size

The derivative type

string $prefix

A prefix, can be name of the parent content

boolean $absolute

When true, the current master domain will be attached

Returns

string —

A public url with improved naming convention

GetAssetPath()

GetAssetPath(\FAA\Obj\Generic\Asset|object  $given,string  $image_type,string  $language = FAA_DEFAULT_LANGUAGE,boolean  $nocache = false,string  $ext = null): \FAA\Obj\Result

Get asset object Extract the relevant information from asset object and provide the binary derivative as url

Parameters

\FAA\Obj\Generic\Asset|object $given

A plain system content object

string $image_type

Name of the image type to deliver

string $language

The request language

boolean $nocache

Add a nocache parameter to the result url

string $ext

Override extension on demand

Returns

\FAA\Obj\Result —

A default system result object with information about the asset when parseble

namedAssetPath()

namedAssetPath(string  $url,string  $name,string  $expected): \FAA\Obj\Result

Create a named asset path using asset service

Parameters

string $url

The curl url

string $name

The asset name

string $expected

The expected result path

Returns

\FAA\Obj\Result