‪TYPO3CMS  10.4
TYPO3\CMS\Core\Resource\Index\MetaDataRepository Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Index\MetaDataRepository:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

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

Static Public Member Functions

static MetaDataRepository getInstance ()
 

Protected Member Functions

array getTableFields ()
 

Protected Attributes

string $tableName = 'sys_file_metadata'
 
array $tableFields = array( )
 
EventDispatcherInterface $eventDispatcher
 

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 39 of file MetaDataRepository.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Resource\Index\MetaDataRepository::__construct ( EventDispatcherInterface  $eventDispatcher)

Member Function Documentation

◆ createMetaDataRecord()

array TYPO3\CMS\Core\Resource\Index\MetaDataRepository::createMetaDataRecord (   $fileUid,
array  $additionalFields = [] 
)

Create empty

Parameters
int$fileUid
array$additionalFields
Returns
‪array

Definition at line 137 of file MetaDataRepository.php.

References $GLOBALS, TYPO3\CMS\Core\Resource\Index\MetaDataRepository\getTableFields(), and TYPO3\CMS\Core\Database\Connection\PARAM_LOB.

Referenced by TYPO3\CMS\Core\Resource\MetaDataAspect\save().

◆ findByFile()

◆ findByFileUid()

array TYPO3\CMS\Core\Resource\Index\MetaDataRepository::findByFileUid (   $uid)

Retrieves metadata for file

Parameters
int$uid
Returns
‪array
Exceptions
InvalidUidException

Definition at line 102 of file MetaDataRepository.php.

Referenced by TYPO3\CMS\Core\Resource\Index\MetaDataRepository\findByFile(), TYPO3\CMS\Core\Resource\MetaDataAspect\loadFromRepository(), and TYPO3\CMS\Core\Resource\Index\MetaDataRepository\update().

◆ getInstance()

static MetaDataRepository TYPO3\CMS\Core\Resource\Index\MetaDataRepository::getInstance ( )
static

◆ getTableFields()

array TYPO3\CMS\Core\Resource\Index\MetaDataRepository::getTableFields ( )
protected

◆ removeByFileUid()

TYPO3\CMS\Core\Resource\Index\MetaDataRepository::removeByFileUid (   $fileUid)

Remove all metadata records for a certain file from the database

Parameters
int$fileUid

Definition at line 206 of file MetaDataRepository.php.

Referenced by TYPO3\CMS\Core\Resource\MetaDataAspect\remove().

◆ update()

TYPO3\CMS\Core\Resource\Index\MetaDataRepository::update (   $fileUid,
array  $data 
)

Updates the metadata record in the database

Parameters
int$fileUid‪the file uid to update
array$data‪Data to update

Definition at line 170 of file MetaDataRepository.php.

References TYPO3\CMS\Core\Resource\Index\MetaDataRepository\findByFileUid(), and TYPO3\CMS\Core\Resource\Index\MetaDataRepository\getTableFields().

Referenced by TYPO3\CMS\Core\Resource\Index\MetaDataRepository\findByFile(), and TYPO3\CMS\Core\Resource\MetaDataAspect\save().

Member Data Documentation

◆ $eventDispatcher

EventDispatcherInterface TYPO3\CMS\Core\Resource\Index\MetaDataRepository::$eventDispatcher
protected

◆ $tableFields

array TYPO3\CMS\Core\Resource\Index\MetaDataRepository::$tableFields = array( )
protected

Internal storage for database table fields

Definition at line 49 of file MetaDataRepository.php.

Referenced by TYPO3\CMS\Core\Resource\Index\MetaDataRepository\getTableFields().

◆ $tableName

string TYPO3\CMS\Core\Resource\Index\MetaDataRepository::$tableName = 'sys_file_metadata'
protected

Definition at line 43 of file MetaDataRepository.php.