TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
MetaDataRepository Class Reference
Inheritance diagram for MetaDataRepository:
SingletonInterface

Public Member Functions

 findByFile (File $file)
 
 findByFileUid ($uid)
 
 createMetaDataRecord ($fileUid, array $additionalFields=[])
 
 update ($fileUid, array $data)
 
 removeByFileUid ($fileUid)
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 getSignalSlotDispatcher ()
 
 getObjectManager ()
 
 emitRecordPostRetrievalSignal (\ArrayObject $data)
 
 emitRecordUpdatedSignal (array $data)
 
 emitRecordCreatedSignal (array $data)
 
 emitRecordDeletedSignal ($fileUid)
 

Protected Attributes

 $tableName = 'sys_file_metadata'
 
 $tableFields = []
 

Detailed Description

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

Definition at line 35 of file MetaDataRepository.php.

Member Function Documentation

createMetaDataRecord (   $fileUid,
array  $additionalFields = [] 
)

Create empty

Parameters
int$fileUid
array$additionalFields
Returns
array

Definition at line 127 of file MetaDataRepository.php.

References $GLOBALS, MetaDataRepository\emitRecordCreatedSignal(), and GeneralUtility\makeInstance().

Referenced by MetaDataRepository\findByFileUid().

emitRecordCreatedSignal ( array  $data)
protected

Signal that is called after an IndexRecord is created

Parameters
array$data

Definition at line 260 of file MetaDataRepository.php.

References MetaDataRepository\getSignalSlotDispatcher().

Referenced by MetaDataRepository\createMetaDataRecord().

emitRecordDeletedSignal (   $fileUid)
protected

Signal that is called after an IndexRecord is deleted

Parameters
int$fileUid

Definition at line 271 of file MetaDataRepository.php.

References MetaDataRepository\getSignalSlotDispatcher().

Referenced by MetaDataRepository\removeByFileUid().

emitRecordPostRetrievalSignal ( \ArrayObject  $data)
protected

Signal that is called after a record has been loaded from database Allows other places to do extension of metadata at runtime or for example translation and workspace overlay

Parameters
\ArrayObject$data

Definition at line 238 of file MetaDataRepository.php.

References MetaDataRepository\getSignalSlotDispatcher().

Referenced by MetaDataRepository\findByFileUid().

emitRecordUpdatedSignal ( array  $data)
protected

Signal that is called after an IndexRecord is updated

Parameters
array$data

Definition at line 249 of file MetaDataRepository.php.

References MetaDataRepository\getSignalSlotDispatcher().

Referenced by MetaDataRepository\update().

findByFileUid (   $uid)

Retrieves metadata for file

Parameters
int$uid
Returns
array
Exceptions
InvalidUidException

Definition at line 89 of file MetaDataRepository.php.

References MetaDataRepository\createMetaDataRecord(), MetaDataRepository\emitRecordPostRetrievalSignal(), and GeneralUtility\makeInstance().

Referenced by MetaDataRepository\findByFile(), and MetaDataRepository\update().

static getInstance ( )
static
getObjectManager ( )
protected

Get the ObjectManager

Returns
ObjectManager

Definition at line 225 of file MetaDataRepository.php.

References GeneralUtility\makeInstance().

Referenced by MetaDataRepository\getSignalSlotDispatcher().

removeByFileUid (   $fileUid)

Remove all metadata records for a certain file from the database

Parameters
int$fileUid
Returns
void

Definition at line 197 of file MetaDataRepository.php.

References MetaDataRepository\emitRecordDeletedSignal(), and GeneralUtility\makeInstance().

update (   $fileUid,
array  $data 
)

Updates the metadata record in the database

Parameters
int$fileUidthe file uid to update
array$dataData to update
Returns
void

Definition at line 162 of file MetaDataRepository.php.

References MetaDataRepository\emitRecordUpdatedSignal(), MetaDataRepository\findByFileUid(), and GeneralUtility\makeInstance().

Referenced by MetaDataRepository\findByFile().

Member Data Documentation

$tableFields = []
protected

Definition at line 47 of file MetaDataRepository.php.

$tableName = 'sys_file_metadata'
protected

Definition at line 40 of file MetaDataRepository.php.