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

Public Member Functions

 __construct (EventDispatcherInterface $eventDispatcher)
 
array false findOneByUid ($fileUid)
 
array false findOneByStorageUidAndIdentifierHash ($storageUid, $identifierHash)
 
array bool findOneByStorageAndIdentifier (ResourceStorage $storage, $identifier)
 
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 (int $id)
 

Protected Member Functions

 insertRecord (array $data)
 

Protected Attributes

string $table = 'sys_file'
 
EventDispatcherInterface $eventDispatcher
 
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 43 of file FileIndexRepository.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ add()

◆ addRaw()

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

Add data from record (at indexing time)

Returns
‪array

Definition at line 294 of file FileIndexRepository.php.

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

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

References TYPO3\CMS\Core\Database\Connection\PARAM_INT, TYPO3\CMS\Core\Database\Connection\PARAM_INT_ARRAY, and TYPO3\CMS\Core\Database\Connection\PARAM_STR_ARRAY.

◆ findInStorageAndNotInUidList()

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

Helper function for the Indexer to detect missing files

Parameters
int[]$uidList
Returns
‪array

Definition at line 422 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\ResourceStorage\getUid(), and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

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
int$limit
Returns
‪array

Definition at line 394 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Resource\ResourceStorage\getUid(), and TYPO3\CMS\Core\Database\Connection\PARAM_INT.

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

◆ findOneByFileObject()

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

◆ findOneByStorageAndIdentifier()

array bool TYPO3\CMS\Core\Resource\Index\FileIndexRepository::findOneByStorageAndIdentifier ( ResourceStorage  $storage,
  $identifier 
)

◆ findOneByStorageUidAndIdentifierHash()

array false 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|false

only for use from FileRepository

Definition at line 99 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Database\Connection\PARAM_INT.

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

◆ findOneByUid()

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

Retrieves Index record for a given $fileUid

Parameters
int$fileUid
Returns
‪array|false

Definition at line 73 of file FileIndexRepository.php.

References TYPO3\CMS\Core\Database\Connection\PARAM_INT.

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

◆ hasIndexRecord()

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

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

◆ remove()

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

Remove a sys_file record from the database

Parameters
int$fileUid

Definition at line 494 of file FileIndexRepository.php.

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

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

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

◆ updateRefIndex()

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

Member Data Documentation

◆ $eventDispatcher

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

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

◆ $table

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

Definition at line 47 of file FileIndexRepository.php.