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<string|int, mixed>
- Create empty
- findByFile() : array<string|int, mixed>
- 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<string|int, mixed>
- 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<string|int, mixed> $additionalFields = [] ]) : array<string|int, mixed>
    Parameters
- $fileUid : int
- $additionalFields : array<string|int, mixed> = []
Return values
array<string|int, mixed>findByFile()
Returns array of meta-data properties
    public
                    findByFile(File $file) : array<string|int, mixed>
    Parameters
- $file : File
Return values
array<string|int, mixed>findByFileUid()
Retrieves metadata for file
    public
                    findByFileUid(int $uid) : array<string, string>
    Parameters
- $uid : int
Tags
Return values
array<string, string> —$metaData
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<string|int, mixed> $updateData[, array<string|int, mixed>|null $metaDataFromDatabase = null ]) : array<string|int, mixed>
    Parameters
- $fileUid : int
- 
                    the file uid to update 
- $updateData : array<string|int, mixed>
- 
                    Data to update 
- $metaDataFromDatabase : array<string|int, mixed>|null = null
- 
                    Current meta data from database 
Return values
array<string|int, mixed> —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>