MetaDataRepository

class \TYPO3\CMS\Core\Resource\Index\MetaDataRepository

Implements
SingletonInterface

Repository Class as an abstraction layer to sys_file_metadata

Every access to table sys_file_metadata which is not handled by DataHandler has to use this Repository class

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Properties

$eventDispatcher  : EventDispatcherInterface
$tableName  : string

Methods

__construct()  : mixed
createMetaDataRecord()  : array
Create empty
findByFile()  : array
Returns array of meta-data properties
findByFileUid()  : array<string, string>
Retrieves metadata for file
removeByFileUid()  : mixed
Remove all metadata records for a certain file from the database
update()  : array
Updates the metadata record in the database
getTableFields()  : array<string, ColumnInfo>
Gets the fields that are available in the table

Properties

$eventDispatcher read-only

protected EventDispatcherInterface $eventDispatcher

$tableName

protected string $tableName = 'sys_file_metadata'

Methods

__construct()

public __construct(EventDispatcherInterface $eventDispatcher) : mixed

Parameters

$eventDispatcher : EventDispatcherInterface

createMetaDataRecord()

Create empty

public createMetaDataRecord(int $fileUid[, array $additionalFields = [] ]) : array

Parameters

$fileUid : int
$additionalFields : array = []

Return values

array

findByFile()

Returns array of meta-data properties

public findByFile(File $file) : array

Parameters

$file : File

Return values

array

removeByFileUid()

Remove all metadata records for a certain file from the database

public removeByFileUid(int $fileUid) : mixed

Parameters

$fileUid : int

update()

Updates the metadata record in the database

public update(int $fileUid, array $updateData[, array|null $metaDataFromDatabase = null ]) : array

Parameters

$fileUid : int

the file uid to update

$updateData : array

Data to update

$metaDataFromDatabase : array|null = null

Current meta data from database

Return values

array —

The updated database record - or just $metaDataFromDatabase if no update was done

getTableFields()

Gets the fields that are available in the table

protected getTableFields() : array<string, ColumnInfo>

Return values

array<string, ColumnInfo>
On this page