Class: Media

.fields. Media


new Media(name, type, schema, value, $endpoint, service, $states, relationName)

Apy Media Field

A Media type shall be any type of Resource (music, picture, video, ...)

Parameters:
Name Type Description
name string

Field name

type string

Field type

schema Object

Field schema

value Object

Field value

$endpoint string

Field endpoint

service Object

Reference to Service instance

$states Object

Field inner state holder instance

relationName string

(optional) Field relation name

Extends

Methods


<static> cleanedData()

Get cleaned data

Returns:

Either null or a wrapped file object

Type
null | Object

<static> cloneValue(value)

Media field - clone a value

Parameters:
Name Type Description
value string | apy.helpers.MediaFile

Either a string or wrapped file

Returns:

cloned value

Type
apy.helpers.MediaFile

<static> hasUpdated()

Return true if original value has changed from current one. In other words, if $lastModifiedDate is different from original value

Returns:

Is the String field updated ?

Type
boolean

<static> reset()

Reset inner value to its original value ($memo) if different

Returns:

this

Type
apy.components.fields.Media

<static> toString()

Media field string representation

Returns:

Media field string representation

Type
string

<static> validate()

Override parent property to specified validation behaviour.