class Asset extends LocalizedResource implements JsonSerializable

Properties

protected string[] $availableLocales List of codes for all the locales available in the space this resource belongs to. from LocalizedResource

Methods

__construct(array $title, array $description, array $file, SystemProperties $sys)

Asset constructor.

$this
setLocale(Locale|string $locale)

Set the locale for this instance. All future calls to a getter will return the information for this locale.

string
getLocale()

The locale code for the currently set locale.

string
getLocaleFromInput(Locale|string|null $input = null)

No description

string|null
loopThroughFallbackChain(array $valueMap, string $localeCode, Space $space)

No description

string|null
getTitle(Locale|string|null $locale = null)

The title of the asset.

string|null
getDescription(Locale|string|null $locale = null)

No description

getFile(Locale|string|null $locale = null)

No description

string
getId()

Returns the ID of this Asset.

int
getRevision()

Returns the Revision of this Asset.

getUpdatedAt()

Returns the time when this Asset was last changed.

getCreatedAt()

Returns the time when this Asset was created.

getSpace()

Returns the Space this Asset belongs to.

object
jsonSerialize()

Returns an object to be used by json_encode to serialize objects of this class.

Details

at line 44
__construct(array $title, array $description, array $file, SystemProperties $sys)

Asset constructor.

Parameters

array $title
array $description
array $file
SystemProperties $sys

in LocalizedResource at line 55
$this setLocale(Locale|string $locale)

Set the locale for this instance. All future calls to a getter will return the information for this locale.

Parameters

Locale|string $locale the locale code as string or an instance of Locale

Return Value

$this

Exceptions

InvalidArgumentException when $locale is not one of the locales supported by the space

in LocalizedResource at line 75
string getLocale()

The locale code for the currently set locale.

Return Value

string

in LocalizedResource at line 87
protected string getLocaleFromInput(Locale|string|null $input = null)

Parameters

Locale|string|null $input

Return Value

string

Exceptions

InvalidArgumentException when $locale is not one of the locales supported by the space

in LocalizedResource at line 113
protected string|null loopThroughFallbackChain(array $valueMap, string $localeCode, Space $space)

Parameters

array $valueMap
string $localeCode
Space $space

Return Value

string|null The locale code for which a value can be found. null if the end of the chain has been reached.

Exceptions

RuntimeException If we detect an endless loop

at line 63
string|null getTitle(Locale|string|null $locale = null)

The title of the asset.

Parameters

Locale|string|null $locale

Return Value

string|null

Exceptions

InvalidArgumentException when $locale is not one of the locales supported by the space

at line 84
string|null getDescription(Locale|string|null $locale = null)

Parameters

Locale|string|null $locale

Return Value

string|null

Exceptions

InvalidArgumentException when $locale is not one of the locales supported by the space

at line 105
FileInterface getFile(Locale|string|null $locale = null)

Parameters

Locale|string|null $locale

Return Value

FileInterface

Exceptions

InvalidArgumentException when $locale is not one of the locales supported by the space

at line 124
string getId()

Returns the ID of this Asset.

Return Value

string

at line 134
int getRevision()

Returns the Revision of this Asset.

Return Value

int

at line 144
DateTimeImmutable getUpdatedAt()

Returns the time when this Asset was last changed.

Return Value

DateTimeImmutable

at line 154
DateTimeImmutable getCreatedAt()

Returns the time when this Asset was created.

Return Value

DateTimeImmutable

at line 164
Space getSpace()

Returns the Space this Asset belongs to.

Return Value

Space

at line 176
object jsonSerialize()

Returns an object to be used by json_encode to serialize objects of this class.

Return Value

object

See also

http://php.net/manual/en/jsonserializable.jsonserialize.php JsonSerializable::jsonSerialize