MetaDataAspect implements ArrayAccess, Countable, Iterator

Aspect that takes care of a file's metadata

Table of Contents

Interfaces

ArrayAccess
Countable
Iterator

Methods

__construct()  : mixed
Constructor
add()  : $this
Adds already known metadata to the aspect
count()  : int
current()  : mixed
Gets the current value of iteration
get()  : array<string|int, mixed>
Gets the metadata of a file. If not metadata is loaded yet, the database gets queried
getContextIdentifier()  : string
The metadata record is resolved for the language and workspace of the current context, so a loaded record must not be reused once that context changed within the same request. This is relevant whenever more than one language is rendered in a single process, for instance a command controller, a cache warmup or an Extbase query for a specific language.
key()  : string
Returns the key of the current iteration
next()  : void
Increases the index for iteration
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
remove()  : void
Removes a meta data record
rewind()  : void
Resets the internal iterator counter
save()  : void
Creates new or updates existing meta data
valid()  : bool
getMetaDataRepository()  : MetaDataRepository
loadFromRepository()  : array<string|int, mixed>

Methods

__construct()

Constructor

public __construct(File $file) : mixed
Parameters
$file : File

add()

Adds already known metadata to the aspect

public add(array<string|int, mixed> $metaData) : $this
Parameters
$metaData : array<string|int, mixed>
Internal
Return values
$this

count()

public count() : int
Return values
int

current()

Gets the current value of iteration

public current() : mixed

get()

Gets the metadata of a file. If not metadata is loaded yet, the database gets queried

public get() : array<string|int, mixed>
Return values
array<string|int, mixed>

getContextIdentifier()

The metadata record is resolved for the language and workspace of the current context, so a loaded record must not be reused once that context changed within the same request. This is relevant whenever more than one language is rendered in a single process, for instance a command controller, a cache warmup or an Extbase query for a specific language.

public getContextIdentifier() : string
Internal
Tags
todo

The language is still not an input of the resolution: MetaDataRepository::findByFileUid() resolves for whatever the current context happens to be, so an explicitly requested language - Extbase query settings or a cloned Context as used by PageLinkBuilder, HrefLangGenerator or language menus - is ignored. It should become an explicit argument instead, and this cache should be keyed by it rather than by the current context. FileReference::getProperties() memoizes the merged metadata and uses this identifier for the very same reason, which is why it is exposed at all.

Return values
string

key()

Returns the key of the current iteration

public key() : string
Return values
string

next()

Increases the index for iteration

public next() : void

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

remove()

Removes a meta data record

public remove() : void
Internal

rewind()

Resets the internal iterator counter

public rewind() : void

save()

Creates new or updates existing meta data

public save() : void
Internal

valid()

public valid() : bool
Return values
bool

loadFromRepository()

protected loadFromRepository() : array<string|int, mixed>
Return values
array<string|int, mixed>
On this page

Search results