TYPO3 CMS  TYPO3_8-7
TYPO3\CMS\Core\Resource\Index\FileIndexRepository Class Reference
Inheritance diagram for TYPO3\CMS\Core\Resource\Index\FileIndexRepository:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

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

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 getResourceFactory ()
 
 insertRecord (array $data)
 
 getSignalSlotDispatcher ()
 
 getObjectManager ()
 
 emitRecordUpdatedSignal (array $data)
 
 emitRecordCreatedSignal (array $data)
 
 emitRecordDeletedSignal ($fileUid)
 
 emitRecordMarkedAsMissingSignal ($fileUid)
 

Protected Attributes

 $table = 'sys_file'
 
 $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 38 of file FileIndexRepository.php.

Member Function Documentation

◆ add()

◆ addRaw()

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().

◆ emitRecordCreatedSignal()

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

Signal that is called after an IndexRecord is created

Parameters
array$data

Definition at line 596 of file FileIndexRepository.php.

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

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

◆ 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 607 of file FileIndexRepository.php.

References 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 618 of file FileIndexRepository.php.

References 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 585 of file FileIndexRepository.php.

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

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

◆ findByContentHash()

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.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ findByFolder()

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

◆ findByFolders()

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.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ findInStorageAndNotInUidList()

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(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ findInStorageWithIndexOutstanding()

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(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ findOneByCombinedIdentifier()

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(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ findOneByFileObject()

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

◆ findOneByStorageUidAndIdentifier()

TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findOneByStorageUidAndIdentifier (   $storageUid,
  $identifier 
)

Retrieves Index record for a given $storageUid and $identifier

Parameters
int$storageUid
string$identifier
Returns
array|bool

Definition at line 119 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Index\FileIndexRepository\findOneByStorageUidAndIdentifierHash(), and TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getResourceFactory().

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

◆ findOneByStorageUidAndIdentifierHash()

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

Definition at line 134 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

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

◆ findOneByUid()

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.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ getInstance()

◆ getObjectManager()

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

Get the ObjectManager

Returns
ObjectManager

Definition at line 574 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

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

◆ getResourceFactory()

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

◆ getSignalSlotDispatcher()

◆ hasIndexRecord()

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

◆ insertRecord()

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

◆ markFileAsMissing()

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

Marks given file as missing in sys_file

Parameters
int$fileUid

Definition at line 514 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Index\FileIndexRepository\emitRecordMarkedAsMissingSignal(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ remove()

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

Remove a sys_file record from the database

Parameters
int$fileUid

Definition at line 534 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Index\FileIndexRepository\emitRecordDeletedSignal(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ 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.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Member Data Documentation

◆ $fields

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

Definition at line 50 of file FileIndexRepository.php.

◆ $table

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

Definition at line 43 of file FileIndexRepository.php.