TYPO3 CMS  TYPO3_7-6
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 (\TYPO3\CMS\Core\Resource\FileInterface $fileObject)
 
 findByContentHash ($hash)
 
 findByFolder (\TYPO3\CMS\Core\Resource\Folder $folder)
 
 findByFolders (array $folders, $includeMissing=true, $fileName=null)
 
 add (File $file)
 
 addRaw (array $data)
 
 hasIndexRecord (File $file)
 
 update (File $file)
 
 findInStorageWithIndexOutstanding (\TYPO3\CMS\Core\Resource\ResourceStorage $storage, $limit=-1)
 
 findInStorageAndNotInUidList (\TYPO3\CMS\Core\Resource\ResourceStorage $storage, array $uidList)
 
 updateIndexingTime ($fileUid)
 
 markFileAsMissing ($fileUid)
 
 remove ($fileUid)
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 getDatabaseConnection ()
 
 getResourceFactory ()
 
 insertRecord (array $data)
 
 getWhereClauseForFile (File $file)
 
 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 TCEmain has to use this Repository class.

This is meant for FAL internal use only!.

Definition at line 30 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 270 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 467 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 478 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 489 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 456 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 161 of file FileIndexRepository.php.

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

◆ findByFolder()

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

Find all records for files in a Folder

Parameters
\TYPO3\CMS\Core\Resource\Folder$folder
Returns
array|NULL

Definition at line 180 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Index\FileIndexRepository\$table, and TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getDatabaseConnection().

◆ 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

Definition at line 203 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Index\FileIndexRepository\$table, and TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getDatabaseConnection().

◆ findInStorageAndNotInUidList()

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

Helper function for the Indexer to detect missing files

Parameters
\TYPO3\CMS\Core\Resource\ResourceStorage$storage
array$uidList
Returns
array

Definition at line 351 of file FileIndexRepository.php.

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

◆ findInStorageWithIndexOutstanding()

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

Finds the files needed for second indexer step

Parameters
\TYPO3\CMS\Core\Resource\ResourceStorage$storage
int$limit
Returns
array

Definition at line 332 of file FileIndexRepository.php.

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

◆ 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 83 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 ( \TYPO3\CMS\Core\Resource\FileInterface  $fileObject)

Retrieves Index record for a given $fileObject

Parameters
\TYPO3\CMS\Core\Resource\FileInterface$fileObject
Returns
array|bool

Definition at line 147 of file FileIndexRepository.php.

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

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

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

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

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

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

◆ getDatabaseConnection()

◆ getInstance()

◆ getObjectManager()

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

Get the ObjectManager

Returns

Definition at line 445 of file FileIndexRepository.php.

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

◆ getResourceFactory()

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

◆ getSignalSlotDispatcher()

◆ getWhereClauseForFile()

◆ 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
Returns
void

Definition at line 377 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\Index\FileIndexRepository\emitRecordMarkedAsMissingSignal(), and TYPO3\CMS\Core\Resource\Index\FileIndexRepository\getDatabaseConnection().

◆ 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
Returns
void

Definition at line 366 of file FileIndexRepository.php.

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

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

◆ $table