‪TYPO3CMS  9.5
TYPO3\CMS\Core\Resource\Index\FileIndexRepository Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Index\FileIndexRepository:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

array bool findOneByCombinedIdentifier ($combinedIdentifier)
 
array bool findOneByUid ($fileUid)
 
array bool findOneByStorageUidAndIdentifier ($storageUid, $identifier)
 
array bool findOneByStorageUidAndIdentifierHash ($storageUid, $identifierHash)
 
array bool findOneByFileObject (FileInterface $fileObject)
 
mixed findByContentHash ($hash)
 
array null findByFolder (Folder $folder)
 
array null findByFolders (array $folders, $includeMissing=true, $fileName=null)
 
 add (File $file)
 
array addRaw (array $data)
 
bool hasIndexRecord (File $file)
 
 update (File $file)
 
array findInStorageWithIndexOutstanding (ResourceStorage $storage, $limit=-1)
 
array findInStorageAndNotInUidList (ResourceStorage $storage, array $uidList)
 
 updateIndexingTime ($fileUid)
 
 markFileAsMissing ($fileUid)
 
 remove ($fileUid)
 
 updateRefIndex ($id)
 
array findBySearchWordInMetaData ($searchWord)
 

Static Public Member Functions

static FileIndexRepository getInstance ()
 

Protected Member Functions

ResourceFactory getResourceFactory ()
 
int insertRecord (array $data)
 
Dispatcher getSignalSlotDispatcher ()
 
ObjectManager getObjectManager ()
 
 emitRecordUpdatedSignal (array $data)
 
 emitRecordCreatedSignal (array $data)
 
 emitRecordDeletedSignal ($fileUid)
 
 emitRecordMarkedAsMissingSignal ($fileUid)
 

Protected Attributes

string $table = 'sys_file'
 
array $fields
 

Detailed Description

Repository Class as an abstraction layer to sys_file

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

This is meant for FAL internal use only!

Definition at line 40 of file FileIndexRepository.php.

Member Function Documentation

◆ add()

◆ addRaw()

array TYPO3\CMS\Core\Resource\Index\FileIndexRepository::addRaw ( array  $data)

Add data from record (at indexing time)

Parameters
array$data
Returns
‪array

Definition at line 325 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Index\FileIndexRepository\insertRecord().

Referenced by TYPO3\CMS\Core\Resource\Index\Indexer\createIndexEntry().

◆ emitRecordCreatedSignal()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::emitRecordCreatedSignal ( array  $data)
protected

◆ emitRecordDeletedSignal()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::emitRecordDeletedSignal (   $fileUid)
protected

Signal that is called after an IndexRecord is deleted

Parameters
int$fileUid

Definition at line 626 of file FileIndexRepository.php.

References TYPO3\CMS\Extbase\SignalSlot\Dispatcher\dispatch(), and TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getSignalSlotDispatcher().

Referenced by TYPO3\CMS\Core\Resource\Index\FileIndexRepository\remove().

◆ emitRecordMarkedAsMissingSignal()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::emitRecordMarkedAsMissingSignal (   $fileUid)
protected

Signal that is called after an IndexRecord is marked as missing

Parameters
int$fileUid

Definition at line 636 of file FileIndexRepository.php.

References TYPO3\CMS\Extbase\SignalSlot\Dispatcher\dispatch(), and TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getSignalSlotDispatcher().

Referenced by TYPO3\CMS\Core\Resource\Index\FileIndexRepository\markFileAsMissing().

◆ emitRecordUpdatedSignal()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::emitRecordUpdatedSignal ( array  $data)
protected

Signal that is called after an IndexRecord is updated

Parameters
array$data

Definition at line 606 of file FileIndexRepository.php.

References TYPO3\CMS\Extbase\SignalSlot\Dispatcher\dispatch(), and TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getSignalSlotDispatcher().

Referenced by TYPO3\CMS\Core\Resource\Index\FileIndexRepository\update().

◆ findByContentHash()

mixed TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findByContentHash (   $hash)

Returns all indexed files which match the content hash Used by the indexer to detect already present files

Parameters
string$hash
Returns
‪mixed

Definition at line 174 of file FileIndexRepository.php.

Referenced by TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\AbstractOnlineMediaHelper\findExistingFileByOnlineMediaId(), and TYPO3\CMS\Core\Resource\Index\Indexer\processChangedAndNewFiles().

◆ findByFolder()

array null TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findByFolder ( Folder  $folder)

◆ findByFolders()

array null TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findByFolders ( array  $folders,
  $includeMissing = true,
  $fileName = null 
)

Find all records for files in an array of Folders

Parameters
Folder[]$folders
bool$includeMissing
string$fileName
Returns
‪array|null

Definition at line 237 of file FileIndexRepository.php.

◆ findBySearchWordInMetaData()

array TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findBySearchWordInMetaData (   $searchWord)

Search for files by search word in metadata

Parameters
string$searchWord‪search word
Deprecated:
‪Use FileSearchQuery instead
Returns
‪array

Definition at line 567 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Search\FileSearchQuery\createForSearchDemand(), and TYPO3\CMS\Core\Resource\Search\FileSearchDemand\createForSearchTerm().

◆ findInStorageAndNotInUidList()

array TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findInStorageAndNotInUidList ( ResourceStorage  $storage,
array  $uidList 
)

Helper function for the Indexer to detect missing files

Parameters
ResourceStorage$storage
int[]$uidList
Returns
‪array

Definition at line 462 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\ResourceStorage\getUid().

Referenced by TYPO3\CMS\Core\Resource\Index\Indexer\detectMissingFiles().

◆ findInStorageWithIndexOutstanding()

array TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findInStorageWithIndexOutstanding ( ResourceStorage  $storage,
  $limit = -1 
)

Finds the files needed for second indexer step

Parameters
ResourceStorage$storage
int$limit
Returns
‪array

Definition at line 433 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\ResourceStorage\getUid().

Referenced by TYPO3\CMS\Core\Resource\Index\Indexer\runMetaDataExtraction().

◆ findOneByCombinedIdentifier()

array bool TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findOneByCombinedIdentifier (   $combinedIdentifier)

Retrieves Index record for a given $combinedIdentifier

Parameters
string$combinedIdentifier
Returns
‪array|bool

Definition at line 81 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByStorageUidAndIdentifier().

◆ findOneByFileObject()

array bool TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findOneByFileObject ( FileInterface  $fileObject)

◆ findOneByStorageUidAndIdentifier()

◆ findOneByStorageUidAndIdentifierHash()

array bool TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findOneByStorageUidAndIdentifierHash (   $storageUid,
  $identifierHash 
)

Retrieves Index record for a given $storageUid and $identifier

Parameters
int$storageUid
string$identifierHash
Returns
‪array|bool

only for use from FileRepository

Definition at line 134 of file FileIndexRepository.php.

Referenced by TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByFileObject(), and TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByStorageUidAndIdentifier().

◆ findOneByUid()

array bool TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findOneByUid (   $fileUid)

Retrieves Index record for a given $fileUid

Parameters
int$fileUid
Returns
‪array|bool

Definition at line 93 of file FileIndexRepository.php.

Referenced by TYPO3\CMS\Core\Resource\ResourceFactory\getFileObject().

◆ getInstance()

◆ getObjectManager()

ObjectManager TYPO3\CMS\Core\Resource\Index\FileIndexRepository::getObjectManager ( )
protected

Get the ObjectManager

Returns
‪ObjectManager

Definition at line 596 of file FileIndexRepository.php.

Referenced by TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getSignalSlotDispatcher().

◆ getResourceFactory()

ResourceFactory TYPO3\CMS\Core\Resource\Index\FileIndexRepository::getResourceFactory ( )
protected

◆ getSignalSlotDispatcher()

◆ hasIndexRecord()

bool TYPO3\CMS\Core\Resource\Index\FileIndexRepository::hasIndexRecord ( File  $file)

◆ insertRecord()

int TYPO3\CMS\Core\Resource\Index\FileIndexRepository::insertRecord ( array  $data)
protected

◆ markFileAsMissing()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::markFileAsMissing (   $fileUid)

◆ remove()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::remove (   $fileUid)

◆ update()

◆ updateIndexingTime()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::updateIndexingTime (   $fileUid)

Updates the timestamp when the file indexer extracted metadata

Parameters
int$fileUid

Definition at line 495 of file FileIndexRepository.php.

Referenced by TYPO3\CMS\Core\Resource\Index\Indexer\extractMetaData().

◆ updateRefIndex()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::updateRefIndex (   $id)

Member Data Documentation

◆ $fields

array TYPO3\CMS\Core\Resource\Index\FileIndexRepository::$fields
protected
Initial value:
= array(
'uid', 'pid', 'missing', 'type', 'storage', 'identifier', 'identifier_hash', 'extension',
'mime_type', 'name', 'sha1', 'size', 'creation_date', 'modification_date', 'folder_hash'
)

A list of properties which are to be persisted

Definition at line 50 of file FileIndexRepository.php.

◆ $table

string TYPO3\CMS\Core\Resource\Index\FileIndexRepository::$table = 'sys_file'
protected

Definition at line 44 of file FileIndexRepository.php.