TYPO3 CMS  TYPO3_6-2
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)
 
 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)
 

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 31 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 209 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 396 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
integer$fileUid

Definition at line 406 of file FileIndexRepository.php.

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

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

◆ 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 386 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 155 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 173 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 286 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
integer$limit
Returns
array

Definition at line 267 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|boolean

Definition at line 82 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|boolean

Definition at line 142 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|boolean

Definition at line 111 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
integer$storageUid
string$identifierHash
Returns
array|boolean

Definition at line 125 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|boolean

Definition at line 93 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 374 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
integer$fileUid
Returns
void

Definition at line 310 of file FileIndexRepository.php.

References 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
integer$fileUid
Returns
void

Definition at line 300 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:
= array(
'uid', 'pid', 'missing', 'type', 'storage', 'identifier', 'identifier_hash', 'extension',
'mime_type', 'name', 'sha1', 'size', 'creation_date', 'modification_date', 'folder_hash'
)

Definition at line 43 of file FileIndexRepository.php.

◆ $table

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